are the middle child they are between sedimentary and igneous. There is no sharp line where suddenly turn into metamorphic and metamorphic turn into igneous just like there is no line where a puppy turns into an adult dog. It just happens gradually.
When sedimentary rocks are buried deep in the earth the weight of all the rocks above push down on them and squeeze them. The deeper they are and the increased pressure lead to the sedimentary rocks heating and beginning to act like a thick playdough. They never get hot enough to totally melt but they are hot enough to bend and fold and minerals to begin the change. Crystals grow and minerals line up in layers. The pressure from above pushes the layers around and makes them into beautiful streaked rocks.
. Sedimentary shale and sandstone turn from shale gradually into slate. The slate becomes beautiful shinny schist. Crystals begin to grow and the schists become gneiss with many streaks. Bury and heat the gneiss so it begins to totally melt enough and it becomes granite.
NOTE: Granite can also form directly from magma but must do so VERY slowly. If magma cools too fast the crystals don’t have time to grown and it is basalt. Metamorphics are my favorite rocks.