Magnet

How does the magnet work?

The earth is a giant magnet, on which the arrows of the compass are oriented.