The Earth’s geomagnetic field is created because of two things. The convective motions in the liquid conducting core inside the center of the Earth are important for making the magnetic field. When the convective motions occur with the electrical currents around the Earth, the magnetic field is created. The Earth’s rotation is what keeps the magnetic field up. The interaction between the convective motions and the electrical currents creates a dynamo effect.