The separation of Earth's main layers is primarily caused by differences in density between the layers. Density is a measure of the mass of a substance per unit volume, and it can vary depending on the composition and temperature of the material.
The Earth's crust, which is the outermost layer, is relatively low in density compared to the mantle and core. This is because the crust is composed mostly of lighter materials, such as rock and soil, which have a lower density than the denser metals that make up the mantle and core.
As a result of these differences in density, the crust floats on top of the mantle, much like oil floating on top of water. The mantle, which is the thickest layer of Earth, is composed of hot, dense rock that is semi-solid and capable of flowing slowly over time.
Beneath the mantle is the outer core, which is a layer of molten metal, primarily iron and nickel. The outer core is less dense than the mantle, but more dense than the crust. The inner core, which is the very center of the Earth, is a solid ball of metal that is even denser than the outer core.
Overall, the separation of Earth's main layers is caused by differences in density between the layers, with the densest materials sinking to the center of the planet and the lighter materials floating on top.