The Earth's Magnetic Field
The Earth behaves as if there is a bar magnet in it
.
In the diagram above there is an imaginary magnet drawn, note the south pole of the magnet is in the northern hemisphere in order to attract the north pole of a compass.
History of magnetism, What is a magnet