Here's why:
* Earth is a giant magnet: The Earth has a magnetic field that extends out into space. This field is generated by the movement of molten iron in the Earth's core.
* Magnetic poles: The Earth's magnetic field has two poles, a north magnetic pole and a south magnetic pole. These poles are not exactly aligned with the geographic North and South Poles.
* Like poles repel, unlike poles attract: A magnet hung on a string will align itself with the Earth's magnetic field. The north pole of the magnet will be attracted to the Earth's south magnetic pole.
Important note: The magnetic north pole is currently located in the Arctic region of Canada, and it is slowly drifting over time.