Diagram illustrating cave formation and features (Christopherson, 2003)
Caves form in limestone which is made up of calcium carbonate and occasionally in dolomite (calcium magnesium carbonate). The containing dissolved carbon dioxide gets into the cracks and joints. The carbon dioxide can come from organic matter in the soil or the atmosphere. The acidic water dissolves the rock which forms cavities, these spaces can get very large and join with other caves which make large interconnecting cave systems. The water moving through the rock can join to make underground rivers which can lead to further enlarging sculpting of the cave, this can also cause sink holes to occur on the surface.
Cave Decorations
Once a underground river works itself deeper or water filled space drains, the space left behind can become decorated with various crystalline calcium carbonate formations. After the acidic groundwater passes through limestone, it picks up calcium carbonate. The solution is calcium bicarbonate, when it loses carbon dioxide it deposits solid calcium carbonate. The crystal is usually calcite but it can be aragonite. The appearance of the crystals can be affected by airflow, bacterial and algal colonies but the most significant factor is whether the water drips, seeps, flows or sits in pools. The cave deposits or decorations are referred to as speleothems.
Dripstones
Straws form from drops of water. The crystal forms on the outer rim of each successive drop which constructs a hollow straw, which can grow to over six metres. Stalactites grow from the roof over the cave when a straw gets blocked, forcing the water to flow on the outside. This deposits the calcite, forming carrot shaped points on the roof. Stalagmites form on the floor of the cave under the stalactites from the dripping water. Columns are formed when then stalactite and its corresponding stalagmite touch. Shawls form when trickling water flows down sloping surface. Layers of calcite develop into a fluted curtain.
A photograph I took at Jenolan Caves (2013)