The formation and development of caves is known as speleogenesis, which can occur over the course of millions of years. Caves are formed by various geologic processes and can be variable sizes. These may involve a combination of chemical processes, erosion from water, tectonic forces, microorganisms, pressure, and atmospheric influences. Isotopic dating techniques can be applied to cave sediments, in order to determine the timescale when geologic events may have occurred to help form and shape present day caves.
It is estimated that the maximum depth of a cave cannot be more than 3,000 metres (9,800 ft) due to the pressure of overlying rocks. For karst caves the maximum depth is determined on the basis of the lower limit of karst forming processes, coinciding with the base of the soluble carbonate rocks. Most caves are formed in limestone by dissolution.
Caves can be classified in various other ways as well, including active vs. relict; active caves have water flowing through them, relict caves do not, though water may be retained in them. Types of active caves include inflow caves ("into which a stream sinks"), outflow caves ("from which a stream emerges"), and through caves ("traversed by a stream").
Solutional caves or karst caves are the most frequently occurring caves. Such caves form in rock that is soluble; most occur in limestone, but they can also form in other rocks including chalk, dolomite, marble, salt, and gypsum. Rock is dissolved by natural acid in groundwater that seeps through bedding planes, faults, joints, and comparable features. Over time cracks enlarge to become caves and cave systems.