The magnetic field of the earth is a complex network of north-south radiation. The direction sensor uses this field to accurately determine direction.
The sensor consists of two rectangular coils that detect slight tensions created by the earth's magnetic field. Depending on the position and direction, these tensions vary in intensity. There is a non-magnetic resistance between the two coils, which absorbs the subtle changes in tension.
With each new position, the values that are measured by the resistance change. A microprocessor converts the measurements so that they can be displayed clearly on your watch.