Earth was built by violence, not by gentle accumulation. Dust grains in the young solar system stuck together and grew into rocky bodies; their collisions assembled a larger world while releasing heat. Impacts kept coming. The growing planet became hot enough for much of its interior to melt.
That melting gave Earth its architecture. Through a process called differentiation, dense iron and nickel sank toward the center, while lighter silicate material remained above, forming the mantle and, eventually, the crust. Gravity supplied some of the heat, as incoming material struck the surface and the planet compressed under its own weight. Radioactive decay added more. A major collision may also have helped melt the young planet and produced debris that became the Moon, though the details remain contested. Earth was not a finished sphere waiting to cool; its interior was being sorted as it grew.
The magnetic field is an inheritance of that sorting, but not a simple remnant of ancient heat. In the liquid outer core, electrically conducting metal moves as heat escapes and as the solid inner core grows, releasing lighter material that helps drive convection. Earth's rotation organizes these flows, and their motion generates electric currents through a process called the geodynamo. The field extends into space, where it deflects much of the charged particle stream from the Sun. Its strength and direction change over time. Beneath the rocks that record Earth's beginnings, molten metal is still in motion.