Metamorphism most often occurs deep within earth. Under increased temperature and pressure, the minerals of preexisting rocks become unstable and recrystallize in a solid state to become new minerals. Study of metamorphic rocks yields valuable information about metamorphic conditions on rock and about the geologic history of a region.
Heat provides the energy to drive the chemical changes that result in recrystallization of minerals.
One way is the intrusion by hot magma. This kind of metamorphism is called contact metamorphism. Another important way to get heat is deep burial. Gradual burial in a sedimentary basin can bury rocks formed at the surface to several kilometers. An increase in pressure reduces mineral space and drive chemical reactions that produced new minerals with closer atomic packing and higher density.