It works because the Earth has a partially liquid iron core, which spins and creates a magnetic field. In effect, this creates an enormous bar magnetic which runs north to south, except the south pole of the Earth’s magnet is (almost) at the geographic north pole.
So, anywhere on Earth is a line of magnetic attraction, and a compass (itself a magnet) is sensitive to this. The north pole of the compass is attracted to the south pole of the Earth (which is at the geographic north pole) and repelled by the Earth’s north pole (which is in Antarctica).
Latest Answers