Answer:
The Earth's magnetic field is caused by how the earth's core is made. The earth's core is full of iron, especially in the inner core. That inner core is charged metal that produces electric currents that causes Earth's magnetic field. So because the core has iron, we have a magnetic field.