For Carlsbad Caverns, things are different. Much of the cave was dissolved away by sulfuric acid, not carbonic acid. The sulfuric acid was produced by a form of sulfur eating bacteria, which ate sulfur from ground water that contained hydrogen sulfide. These are similar to the sulfur eating bacteria that live around deep ocean vents.
As they metabolized the hydrogen sulfide, they released sulfuric acid as a byproduct. The sulfuric acid dissolves the calcium carbonate of the limestone, leaving behind deposits of gypsum.