Science Common Sense
1171 - Why does the Earth have a magnetic field that makes the compass point in a fixed direction.
The Earth's magnetic field is created by the movement of liquid iron in its core. This liquid iron spins around and creates electricity. The movement of this electricity is what makes the Earth's magnetic field.
A compass has a small magnet inside of it. When you hold the compass near the Earth's surface, the magnet in the compass is attracted to the Earth's magnetic field. The North Pole of the compass magnet is attracted to the South Pole of the Earth's magnetic field, and vice versa.
This is why the compass always points towards the North Pole (or more accurately, the Earth's magnetic North Pole) when you're near the Earth's surface, which is really handy for navigation.