|Depending on the scientific school of thought that you follow, Earth was originally one of the four inner rotating balls of gas in our solar system. What made them different from other gaseous bodies in the planetary system, was that around these balls of heat and gas, swirled masses of dust particles. A suspected “event” from the sun, blew lighter gaseous bodies further out into space, and left behind those that were now solidifying layers of rock from the particles.
Heat from the inner core, and pressure from gravity, all contributed to the formation of Earth’s crust, which consisted primarily of rock formations. The mineral content of the dust that was heated, compacted and cooled, dictated what kind of rock was created. And when subjected to further events, such as deep compression and heat over thousands of years, the content and nature of the rock formation changed.