The south-pointing chariot was an ancient navigational tool invented in China. They were created centuries before magnetic compasses were used for navigation.
How did they work? They don't automatically point south, like a magnetic compass automatically points in a specific direction. First, the operator manually initialized the chariot by aiming its pointer southward by hand. Then, the chariot rolls along roads. As the chariot turns, it turns its southward pointer relative to its body. Let's say you're heading north, and the chariot is pointing south, behind you. You turn 90 degrees to your right, and are now heading east. The chariot pointer turns too, so that it's still pointing south. This is essentially mechanized dead reckoning.
A south-pointing chariot image from 1609:
It is believed, but not known, that south-pointing chariots generally worked by using differential gears. When the chariot moved in a straight line, both wheels turned at equal speeds, and the south-pointing figure atop the chariot did not move. When the chariot turned, the wheels rotated at different speeds, so the differential caused the south-pointing figure to rotate. There is great contention over the historical origin of the differential gear, but the south-pointing chariot offers a reasonable claim to an early use.
There are significant accuracy problems with using a south-pointing chariot as a means of navigation. First of all, irregularity of the traveled ground surface would introduce errors. Second, even a minuscule variation in the manufacture of the two wheels would introduce compounding errors in the south-pointing figure's orientation. Manufacturing processes in ancient China were not capable of producing the precision necessary to reduce this error. In addition, they could not compensate for the wear and tear of the wheels as they traveled over the ground surface. One option is that the chariot could have only been lowered to the ground when the vehicle towing it was turning.
However, as a cultural amusement, and something that may have been considered "magic" at the time, the south-pointing chariot is a fascinating part of history.
Related: Antikythera Mechanism