The interior of the Earth is separated into a crust, mantle, and core because:
while the Earth was hot early in its history, the dense material sank to the core and the less dense
material floated to the outer part of the Earth
during formation of the planets in the accretion disk, the dense metals were accreted first, followed by
progressively less dense rocks and minerals
plate tectonics causes the dense metal-rich slabs to sink and the outer parts of the Earth are replaced
by less dense material