The dynamo theory proposes a mechanism by which a celestial body such as the Earth generates a magnetic field.