Another candidate for the earth's magnetic fields is convection currents that result from heat rising from the earth's core. Perhaps such convection currents combined with the rotational effects of the earth produce the earth's magnetic field. Whatever the cause, the magnetic field of the earth is not stable, but rather has been wandering around throughout geological time. Geologists know this by studying rock containing iron. Just before the rock solidified, its iron content lined up with the earth's magnetic field.
Geologists can now date the rock and analyze what direction the iron is pointing in.
Right now the magnetic poles are somewhere over the Hudson Bay region of northern Canada and just south of Australia. Most people's confusion seems to lie in the fact that they usually look at magnetic fields from the outside. They need to understand that they are standing in the middle of a field, created by the earth, right now. We exist on the outside surface of the earth, where the field is curved. It helps to visualize yourself with a compass standing on the globe in the picture.