Why does the end of the compass needle, that's often marked "N" for North, always points to the north? The reason is because the Earth itself is a huge "magnet". Earth's North Pole could be considered as the south end of a magnet while Earth's South Pole could be considered as the north end of a magnet. Thus, the north end of a compass needle is always drawn towards the North Pole of the Earth.
When you place a magnet in iron sand, the iron sand will be pulled towards both poles of the magnet. The shape of the iron sand lines that surrounds the magnet shows the magnetic fields that surround the magnet. A magnetic field, similar to the fields that surround the magnet, surrounds the Earth. Thanks to the magnetic field that shields us from harmful particles, we're able to safely live on Earth.