Limestone is composed of calcium carbonate, which dissolves when it reacts with acidic groundwater. This dissolution is a form of chemical weathering that creates large underground cavities over time. Mechanical weathering, by contrast, only breaks rocks physically without changing their chemical composition.