Speleogenesis
Speleogenesis is the origin and development of caves, the primary process that determines essential features of the hydrogeology of karst and guides its evolution. It often deals with the development of caves through limestone, caused by the presence of water with carbon dioxide dissolved within it, producing carbonic acid which permits the dissociation of the calcium carbonate in the limestone.
Limestone
The majority of limestone caves are created by calcium carbonate dissolution by the solvent action of meteoric waters circulating through the rock.
In the presence of carbon dioxide saturated water, calcium carbonate reacts to form the soluble calcium bicarbonate.
CaCO3 + CO2 + H2O → Ca(HCO3)2
As meteoric waters precipitate they dissolve atmospheric carbon dioxide to form a dilute carbonic acid solution, which builds up in permeable fissures, bedding planes, joints, and faults within limestone rocks. The exposed limestone then reacts to become calcium bicarbonate which dissolves in the water and is removed from the fault as the solution flows away.