Whether caves originally developed at, above or below the water table is a question still debated, but it is at least clear that cave water flows to the water table, which level is usually determined by the lowest-lying surface stream or river in the immediate locality. Water flows in at the top of a limestone bed and eventually discharges into a body of water at the bottom, or, sometimes, intermediately into a spring, if the geology approves.
You can perambulate, rather than swim through a goodly portion of a cave mostly because the water table keeps dropping, relative to the surface of the limestone. This can be accomplished in a couple of different ways (should you have a cave you’d like to improve) — by geological uplift of the limestone bed itself, or by lowering of the water table as a local river cuts a deeper channel. Either process tends to leave the upper levels of a cave high and dry (sort of) while the lower reaches commit speleogenesis like crazy to get down to the new water table. In this way, caves extend themselves.
Now if all this business of cave formation is simply a matter of water seeking its own level, and running downhill, the more astute and pesky of you will ask, “How come some cave passages go uphill?” Two reasons. One, if you are walking uphill in a cave, are you so egocentric as to believe that the water must have traveled in the same direction? Two is a little more complicated. Yes, the water may in fact have flowed uphill, but to understand this, you must first understand the two types of passage formation.
In “phreatic” passages, water completely fills the cavity. The channel assumes a tube-like shape, circular or nearly so in cross-section, because the hydrostatic pressure is everywhere uniform. If the hydrostatic pressure is great enough, engendered by tons and tons of water above and behind, then the water in the advancing passage doesn’t care about gravity anymore. It just wants out. Where the force of gravity is negligible compared to the force of water pressure, the water will spurt into any available fissure or more soluble rock mass. If the direction is uphill, well, that’s the way the limestone crumbles. Thus passages formed according to the phreatic method are tube-like, and meander about indiscriminately. Subsequent water flow enlarges the passage and extends it, eventually, to its outlet at the water table.
Now, if the water table takes a dive, and/or if the volume of water passing through the cave diminishes, the upper spaces that were water-filled now become air-filled. Water entering from above now flows along the floor of the passage, carving a channel which is v-shaped in cross-section. This brand of vadose cave-formation results in canyon-like passages.
An extremely common type of passage is a hybrid of these two, occurring when vadose water flows along the floor of an old phreatic tube. The resulting passage is keyhole-shaped in cross-sections, and thence derives its name. Many of these passages are actually the size of keyholes, or so it seems by the time you have extruded yourself through one.