Magnetic material in the Earth‘s core The combination of the Earth‘s rotation and convection currents in the Earth‘s molten core Charged particles from the solar wind It is created by the Earth?s gravitational field
The combination of the Earth's rotation and convection currents in the Earth's molten core causes the earth's magnetic field by the so called dynamo effect. The earth's core is not only molten, it is made up largely of iron - a good conductor of electricity. This theory has been the best explanation since the 1930s and is receiving new confirmation - see link.