The Earth acts like a giant magnet, and a freely suspended magnet aligns itself with the Earth's magnetic field lines.