Exfoliation of rock is a result of mechanical weathering. It occurs when there is a rapid change in temperature, which causes rocks to expand and contract. Over time, this expansion and contraction causes the outer layer of the rock to peel away in thin sheets or layers, similar to the way an onion peels. This process is also known as thermal stress weathering, and it is common in areas with large diurnal temperature variations, such as deserts.