It can also be difficult to recognize a metamorphic rock. A weathered slate and shale or even granite and gneiss can appear very similar in the field. However, the processes to form the rocks are different and with a closer look at the minerals it can be possible to understand what kind of process that formed the rock.
(1, Blueschist facies 2, Eclogite facies 3, Prehnite-pumpellyite-facies 4, Greenschist facies 5, Amphibolite-facies 6, Granulite facies 7, Zeolite facies 8, Albite-epidote-hornfels facies 9, Hornblende-hornfels facies 10, Pyroxene-hornfels facies 11, Sanidinite facies)
The temperature and pressure determine what metamorphic rock you get, but the chemical composition is inherited from the protolith. Degrees of metamorphism are called metamorphic facies. This diagram shows at what depth and temperature a particular rock is formed.
Igneous rocks are formed when a melt hardens to crystals and sedimentary rocks are formed from sediments. All rocks weather if exposed to water and air, and weathered material is transported by rivers to oceans where sandstone can be formed from the sand at the beach and shale from the finer sediments further away from the coast. Igneous rocks can be formed as hot magma intrudes the crust and slowly cools down and minerals are formed or form lava at volcanoes. This is known as the rock cycle and is one of the fundamental, but complicated, concepts in geology. You can read more about the rock cycle e.g. here to learn more about rock types and how they are formed.
(source)
The dough slowly moves and deforms, for example by pressure of buckling tectonics from distant tectonic shocks like rising mountain chains. The chemicals inside the dough disamalgamate and coagulate into chemicals that have easy bond affiliation. Every chemical reacts differently and has more or less strong bonds at a set pressure of metamorphism, different blobs inside the metamorphic rock may be more or less mobile and viscous. You get crystals of different sizes of new materials, more often roundish, sometimes flat (gneiss) indicating the flow/pressure in the dough, the crystals branch out not that differently from ice crystals, they recrystallize re-mineralize. The time and pressure of metamorphosis vary a lot and determine the level of change that happens.