Which statement best describes the formation of metamorphic rocks?

Magma cools and crystallizes slowly beneath Earth’s surface.
Liquid lava erupts from a volcano and cools quickly at Earth’s surface.
Sand and gravel are deposited at the mouth of a river and, over time, form layers that solidify into rock.
Ancient sandstone beaches become buried deep beneath Earth’s surface, where they are exposed to extreme heat and pressure