Basically: moving electric charge = magnetic field. It's equivalent, that's why it's called electromagnetism: it's one and the same force.
The Earth rotates, liquid iron (inside Earth) flows => a current flows in the iron => there is a magnetic field.