The structure of the planetesimals and other celestial bodies is mostly from a mixture of dense and light substances. The planetesimals were particles scattered in the universe before the origin of the planets. Other planets including the Earth were formed by the gathering of these planetesimals. As these substances accumulated due to the force of gravity, these collective bodies produced excessive heat.
Due to excessive heat, the earth partially converted into liquid state. Due to excessive temperature, stratification of light and heavy materials began. Heavy substances moved towards the center of the earth and the lighter matter started coming towards the outer periphery. These substances cooled over time, and converted into solid form and became smaller in size. In the end, they developed into the earth’s lithosphere.