Magma first rises to the surface and creates one rock strata. More magma rises up and creates more and more rock strata. Overtime weathering erodes/breaks down some of the rocks on the surface into sediment which deposits into the river/sea/desert. Over time the shells, lobsters, sand, mud, clams deposits into the sea/river/desert which compacts the sediment and turns it into Sedimentary Rocks. Metamorphic and Igneous Rocks can be turned into Sedimentary Rocks through the process of weathering. Sedimentary Rocks and Igneous Rocks can be turned into Metamorphic Rocks through heat and pressure. Rocks normally formed into Metamorphic rocks when it is close to molten magma which would heat it up and the rock would change its form. When melted Sedimentary Rocks, Igneous Rocks, and Metamorphic Rocks would turn into magma. When the magma cools it gets turned into Igneous Rocks.
Sometimes rock strata may have folds in them, folds occur when rocks crumble or break under pressure and strain. Folds can make it hard to tell which rock is older and which is younger because sometimes the rock curves under the older rock making it hard to know which is older. New rocks can also form on folds making a new layer of rocks that are not bent/curved.
Faults also sometimes occur in rock strata. Faults can also be found in rock strata. Faults are cracks in the earth, they are formed when two plates are moving in opposite directions which are called a strike-slip fault, they are created at a transform plate which is where the crust pieces slide across from each other.