

/u-img/00/00/56/00005698.png
The earth behaves like a magnet. The earth’s magnetic fields indicate that an imaginary bar magnet is placed at the centre of the earth as given in the image.
We know that the like poles repel each other and unlike poles attract each other. Hence, any external magnet tries to align in the North-South direction with respect to earth’s magnetic field
