From Academic Kids
Dynamo theory proposes a mechanism by which a celestial body such as the Earth generates a magnetic field. In the case of the Earth, the magnetic field is believed to be caused by the convection of molten iron and nickel, within the outer planetary core, along with Coriolis effect caused by the overall planetary rotation. When conducting fluid flows across an existing magnetic field, electric currents are induced, creating another magnetic field. When this magnetic field reinforces the original magnetic field, a dynamo is created which sustains itself. Similar magnetic fields are present in many celestial bodies including most stars such as the Sun (which contain conducting plasma) and active galactic nuclei.