The field is generated by Earth's rotation, which swirls a thick shell of liquid iron and nickel (the outer core) around a solid ball of metal (the inner core), creating a giant electric dynamo.