As rain water falls through the air, it picks up carbon dioxide. As the water soaks through the soil, it picks up more carbon dioxide which is being given off by decaying vegetation in the soil. Water and carbon dioxide form a mild acid, carbonic acid, which is similar to the fizz in a coke. As this acid seeps through limestone, it dissolves the calcium carbonate out of the limestone. This dissolved mineral is dripped into the cave, where the carbon dioxide is given off. The water will no longer carry the minerals, so they are deposited in the shape of tiny crystals. These crystals are known as calcite, or cave onyx.
Sometimes calcite is deposited as the drips hang from the ceiling of the cave, forming a stalactite. Other times the drops of water are still full of minerals as they drop to the cave floor and build up stalagmites. Beads of moisture sometimes deposit onyx on the cave walls in rough-looking clusters called cave coral. Water flowing slowly down the walls or across an incline in the cave form smooth looking onyx known as flowstone. Onyx formations can take many different shapes, depending on the way the water comes into the cave.