The rock cycle represents the alteration of rock-forming minerals above and below the Earth's surface. At the top of the diagram molten rock material, magma, cools (crystallization) to form igneous rocks. If magma is extruded onto the surface it is called lava. Cooling above the surface yields rocks with fine textures, while those that form from slow cooling beneath the surface typically have large crystals. Igneous rock may remelt when exposed intense heat to form magma again, or be changed into metamorphic rock. Igneous rocks may also be exposed to weathering, erosion and deposition to form sediment, fragments of weathered rock and the precursor for sedimentary rock.
As sediments accumulate they are subjected to compaction and cementation to form sedimentary rock. Sedimentary rocks may be broken down by weathering and erosion to be deposited as sediment, exposed to intense heat and melting to return to magma, or be changed into a metamorphic rock.
Metamorphic rocks are those that have been altered by exposure to heat and/or pressure. The pressure can be created by the weight of material lying above them. The collision of lithospheric plates creates pressure and heat that alters rock. If entirely melted, the rock material forms magma. Erosion and weathering breaks down metamorphic rocks to form sediment, which can be compacted into sedimentary rock.