Magnetic fields surround electric currents, so we surmise that circulating electic currents in the Earth's molten metalic core are the origin of the magnetic field. A current loop gives a field similar to that of the earth. The magnetic field magnitude measured at the surface of the Earth is about half a Gauss and dips toward the Earth in the northern hemisphere. The magnitude varies over the surface of the Earth in the range 0.3 to 0.6 Gauss.