This is a self-turning axle, taking the form of two cubes joined together along one shared face, one of which turns slowly but unstoppably in relation to the other. This slow steady movement generates incredible torque, and can be used to power ventilation, drainage, and other systems in Dwarf communities. The existence of these things explain why Dwarfs can tunnel so deeply and don't have to spend 90% of their time and dwarfpower manually fanning fresh air down to the very deepest levels and expelling spent air. (Even though Dwarfs don't need that much light, and anyway vurms and glow-worms can be relied on to provide a minimalist background glow, they still need to breathe air with oxygen in it, or they asphyxiate like anyone else. Especially at the bottom of a mile-deep mine-working where carbon dioxide, being heavier than air, may be expected to accumulate in large life-threatening amounts).
As with the Cubes, the Dwarfs have frankly no idea how they work, nor who put them there.
Now that Ankh-Morpork has acquired one of these devices by default (or, as the Patrician phrases it, eminent domain) and has no intention of giving it back to the dwarfs, fertile brains are considering a network of ready-made (courtesy of the Dwarfs) tunnels under the city, in association with some sort of track, and wheeled carriages moving on that track, as a means of getting around between strategic points of a city which is hopelessly congested overground. After all, the means of draining the tunnels and powering the carriages has been delivered to them by Vimes and Carrot...