Answer:
The magnetic field is generated by electric currents due to the motion of convection currents of a mixture of molten iron and nickel in the Earth's outer core: these convection currents are caused by heat escaping from the core, a natural process called a geodynamo.
Step-by-step explanation: