How did the earth come to have a molten iron core?
Four and a half billion years ago, Earth (and the other planets in the Solar System) formed when smaller bits of matter in solar orbit came together gravitationally. As a result of those multiple collisions the kinetic energy of motion was converted to heat energy, resulting in a hot, molten mass that would become our Earth.
While in this hot, fluid state, the denser, heavier material (iron and nickel) settled to the center and the less dense rocky material floated nearer the surface, resulting in today's iron/nickel core.
As the Earth radiated energy into space, the outer layers cooled first. The core, being insulated by Earth's outer layers, took longer to cool. That is not the complete story, however. In addition to the initial energy of formation, there are radioactive elements in the Earth with long half lives that continue to release energy. This energy cannot immediately escape into space either, and also accounts for the Earth's hot, molten interior.
Paul Walorski, B.A., Part-time Physics/Astronomy Instructor
'In a way science is a key to the gates of heaven, and the same key opens the gates of hell, and we do not have any instructions as to which is which gate.
Shall we throw away the key and never have a way to enter the gates of heaven? Or shall we struggle with the problem of which is the best way to use the key?'