There are three agents of metamorphism responsible for changing rocks:
The temperature increases with depth, generally. The rate of increase locally is expressed as the geothermal gradient, which is, of course, a faster rate of temperature increase nearer to magma and areas of mountain building. Even in thick sedimentary sequences, in which sedimentary layers have simply been buried over millions of years, there is enough heat to gently spur the regrowth of clay minerals, but metamorphism is only slight. In areas where stronger metamorphism occurs, heat is a primary agent of change, and minerals of all types can change. Chemical reactions are sped up by heat. This is especially true for the regrowth and recrystallization of existing minerals (especially the tiny clay minerals, so common in sedimentary rocks), which may grow larger, and which may provide raw materials for new minerals that grow during metamorphism. So, there is often an increase in crystal size, and the manner of interlocking of crystals, and there is a change in mineralogy.
We can distinguish between confining pressure, that simply caused by burial, or that which exists at a given depth because of the weight of overlying material, and directed pressure, the pressure of collision. Directed pressure, happening from side-to-side instead of from weight from above, involves greater forces, or stress, that compresses rock "sideways." At depth, where rocks are warm, the compression squeezes rock into new plastically deformed configurations called folds, whereas at shallower depths, where rocks are cooler, brittle deformation tends to happen through fracturing and faulting. Change of shape to individual mineral crystals and any particles, such as mineral grains and rock fragments in sedimentary rocks, happens in a fashion that a tennis ball changes shape when you squeeze it. Minerals aren't normally very flexible, but with heat and great stress, deformation like this happens.
Existing minerals can grow larger and new minerals can form during metamorphism. The rate and extent to which this happens depends on several factors, one of which is the availability of ions in solution in contained pore fluids (water charged with ions, essentially). The reason for this relationship is that a growing mineral needs atoms of certain elements to come close to sites in the crystal structure where they fit to form bonds with other elements. With the presence of chemically active fluids, there can be a supply of needed ions, and existing minerals can "recrystallize" (grow larger, and/or reform) and new minerals, formed from chemical elements in existing minerals, can grow. One of the most interesting things about metamorphic rocks is the way new minerals grow during metamorphism within certain temperature and pressure ranges that are specific to different minerals. Of course, to some extent, the way metamorphism happens depends on the chemistry and mineralogy of the parent rock to begin with, but the presence of chemically active fluids can result in the movement of ions out of old minerals and into new growing ones, so the resulting metamorphic rock is considerably or totally different from the original rock.