Inside a mechanical speedometer
A flexible drive cable inside a flexible tube links a small magnet inside the speedometer to the gearbox output shaft.
The magnet rotates with the shaft and its magnetic field attracts a metal drum to turn the speedometer needle against the force of a hair spring. The needle moves round the dial until the restraining force of the hair spring brings it to rest to give a reading of the road speed.