There are some rock types, sandstones and conglomerates for example, that are sufficiently porous to retain rainwater directly as well as that transported through soils and by rivers.
In parts of India the rainy season separates long dry intervals. Old cultures there have built permanent step-wells to access the hidden ground water.
Many steps have become centres of social value and tradition. The excavations still fill-up after heavy rains.