Water has many special properties. Due to its polar nature, water readily reacts with some minerals to pull them apart, and dissolve them into the water as a solution. Salt or halite. for example, is sodium chloride, and in water both elements are dissociated into the water and remain in solution - but can't be seen.
When we add a gas like hydrogen sulfide or carbon dioxide, we make the water's ability to dissolve even stronger by changing its acidity. Acidic water commonly forms from rainwater falling through the atmosphere which dissolves some CO2. This mixture is capable of dissolving limestones and calcite to make caverns. But those rocks form again as new stone, in the form of stalactites, stalagmites and flowstones.
Click HERE for a Mineral Precipitation experiment.