Rocks are naturally occurring aggregates of minerals that make up the lithosphere of Earth. The rock cycle describes how rocks are formed from magma or sediments and changed over time by melting, crystallization, weathering, erosion, deposition, compaction, and metamorphism due to heat and pressure. Sedimentary rocks form from the lithification of sediments, igneous rocks form from the cooling of magma, and metamorphic rocks form from changes to existing rocks by heat and pressure within Earth.