About 450 million years ago, some of the sedimentary rocks began to transform into metamorphic rocks. When sedimentary rocks like limestone or shale were under water, sometimes the weight of the water pressed them so hard that they actually changed the way their molecules locked together and became a different kind of rock. "Metamorphosis" means "changes form", and that's why we call these metamorphic rocks. Because these changes only happen when the rocks happen to be under a lot of pressure, metamorphic rocks are much more rare than igneous or sedimentary rocks.
Each kind of sedimentary rock turns into a different kind of metamorphic rock - limestone turns into travertine or marble, and shale turns into slate, and sandstone turns into quartzite. Even though slate is a metamorphic rock, it still looks a lot like a sedimentary rock - it is still in thin layers.
Igneous rocks can also turn into metamorphic rocks. Granite, for example, changes into a rarer rock called gneiss (pronounced NICE). Also, some metamorphic rocks form out of plants - when the plants die, they decay and turn into peat, which eventually can turn into a sedimentary rock called coal (which is entirely made of carbon atoms), and then if the coal is under pressure, it can become the metamorphic rock graphite (also made of carbon atoms, but they're arranged in a different way). Carbon can also metamorphose into diamonds, but usually not from coal because that transformation happens deep down inside the earth, under tremendous pressure, while coal is on the surface.