Rivers pass over a hard cap rock with softer rock below. As the river erodes the softer rock faster than the hard rock, it creates an overhang. The overhang eventually collapses, forming a steep-sided gorge and waterfall that retreats upstream through further erosion.