Here's a breakdown:
* 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. The specific type of igneous rock depends on:
* The composition of the magma or lava: Different minerals melt at different temperatures, so the composition of the magma determines the minerals present in the resulting igneous rock.
* The rate of cooling: Faster cooling leads to smaller crystals, while slower cooling allows larger crystals to form.
* The environment of cooling: Whether the magma cooled underground or on the surface also affects the resulting rock.
So, the origin of all igneous rocks can be traced back to the molten rock within the Earth, either as magma or lava.