There are several sources of the thermal energy that drives metamorphism. This causes a baking of the neighboring rock called contact metamorphism . The temperature in the Earth goes up with depth. Near the surface in ordinary crust, the temperature rises some 30 degrees per kilometer. Increased pressure drives minerals to form more compact phases, driving for example coal to change into diamonds, and clay to rubies.
Pressure also changes the state of stress.
Crystals will grow or deform by cracking or flowing in response to the change in stress and show either preferential alignment, or evidence of squashing that reflects in some way the stress regime of the new environment. Deformation near fault zones, for example, results in cracking and grinding of rocks and is referred to as cataclastic metamorphism , while deformation deep in the crust occurs more plastically over a wide area producing regional metamorphism . Fluids Changes in the chemistry of the fluids in the pore spaces of rocks also induces change. Diagenesis is not usually considered part of metamorphism although the distinction is a pretty subtle one if you ask me. One common cause of changes in the fluid chemistry is the proximity of something hot - take volcanic activity for example.