How does the Earth Magnetic Field Work?

If you are doing a report on the earth’s magnetic field you will need to know that no one knows for sure how the earth’s magnetic field work. But did you know there is a theory, the earth’s core is thought to consist largely of molten iron.