The valley was formed at the end of the last ice age when the ground was frozen. The frozen ground meant that meltwater from the melting ice sheet formed a large river flowing over the surface, eroding the valley that we see today. The water from this river flowed over Malham Cove to form a huge waterfall.
When the climate warmed around 12,000 years ago the ground thawed and the river in the valley disappeared underground leaving the valley dry as we see it today.