The exposed geology of the Yosemite area includes primarily granitic rocks with some older metamorphic rock. The first rocks were laid down in Precambrian times, when the area around Yosemite National Park was on the edge of a very young North American continent. The sediment that formed the area first settled in the waters of a shallow sea, and compressive forces from a subduction zone in the mid-Paleozoic fused the seabed rocks and sediments, appending them to the continent. Heat generated from the subduction created island arcs of volcanoes (not unlike Japan) that were also thrust into the area of the park. In time, the igneous and sedimentary rocks of the area were later heavily metamorphosed.
Most of the rock now exposed in the park is granitic, having been formed 210 to 80 million years ago as igneous diapirs 6 miles (10 km) below the surface. Over time, most of the overlying rock was uplifted along with the rest of the Sierra Nevada and was removed from the area by erosion. This exposed the granitic rock to much lower pressure, and it was also subjected to erosion in the forms of exfoliation and mass wasting.
Starting about 3 million years ago a series of glaciations further modified the area by accelerating the erosion. During that time large glaciers periodically filled the valleys and canyons. Landslides and river erosion have been the primary erosive forces since the end of the last glacial period, which ended in this area around 12,000 years BP.