Final answer:
The Earth's magnetic field is generated by convection currents in Earth's liquid metallic core, which circulate and create an electric current, producing a magnetic field.
Step-by-step explanation:
The Earth's magnetic field is generated by convection currents in Earth's liquid metallic core. As the liquid metal circulates, it sets up a circulating electric current, which produces a magnetic field. When many charged particles are moving together like that in the core, they produce a magnetic field.