The secret of the magnetic compass lies in the Earth's behaviour as if it had a giant magnet buried deep inside.
The imaginary magnet is arranged with its "south" pole somewhere below the northern coast of Canada and its "north" pole below a spot on the other side of the world, on the rim of the Antarctic icepack. This apparent inversion of the conventional magnetic wisdom makes sense when you recall that "opposite" poles attract; the "north" end of the compass points north because it is drawn by the "south" end of the notional subterranean attractor.
This arrangement is not immutable in geologic time. Every 500,000 years or so, the system "flips" and the magnetic field undergoes complete reversal over a relatively short period: the north magnetic pole becomes the south and vice versa. The last time this happened was about three-quarters of a million years ago, so the inference is that a "flip" is overdue.
Some scientists have been bold enough to predict that it will occur suddenly in about 2,000 years and have speculated on the navigational problems likely to be encountered by those fish, birds and other animals that use the Earth's magnetic field to get their bearings.
More conventional wisdom, however, suggests that even though such a change might be sudden on a geologic timescale, it would be gradual - say over 1,000 years or so - in terms of animal and human life. Any organisms still around in AD 4000 will have ample time to become acclimatised.
Legend has it that the origins of the magnetic compass all began with a shepherd called Magnes who tended his flocks on the slopes of Mount Ida in a region that was then called Asia Minor and which now forms part of Turkey. Magnes, we are told, noticed that his iron crook and the iron nails of his sandals were inclined to cling to a large black stone; he had discovered magnetite, an iron oxide which happens to be naturally magnetic.
The Chinese, some six or seven centuries BC, were the first to notice that a piece of magnetite always pointed in the same direction if it was allowed to swing freely. This unique quality obviously had an important application as a navigational aid - information which the Chinese passed on to the Arabs and the Arabs in due course to the Europeans.
By the 13th century the magnetic compass was in common use among Western seafarers.