The Earth is a huge magnet


           

The magnetic attraction of the Earth is somewhat similar to what one would get if a large bar-magnet existed inside it.

The "magnetic axis" of the Earth, followed by the magnet, is inclined by about 10 degrees to the rotation axis of the Earth.