Here's why:
* Magma: Molten rock found beneath the Earth's surface.
* Lava: Molten rock that has erupted onto the Earth's surface.
When magma or lava cools and solidifies, it forms igneous rocks. These igneous rocks can then be weathered, eroded, transported, and deposited, forming sedimentary rocks. Additionally, existing igneous or sedimentary rocks can be subjected to intense heat and pressure deep within the Earth, transforming them into metamorphic rocks.
So, even though we see a wide variety of rocks today, they all trace their origin back to the molten state of magma or lava.