Millions of years ago, the Yucatan Peninsula was a huge reef covered by the ocean water. It looked very similar to what we see when we are diving off of the coast here today - lots of coral reef, coral caves, coral swim and marine life.
During the last ice age, the level of the ocean dropped, exposing the reef to the climate and time. The coral died and the jungle started growing over the thick limestone platform created by the coral reef. Fossils found inland are the best proof of this and are commonly seen during a cavern dive.
In time, the rain mixed with the carbon dioxide in the atmosphere, forming a weak solution called carbonic acid. The carbonic acid began to work its way through the porous limestone, carving holes in the soft limestone and creating a long network of passageways and tunnels.
The dissolved limestone started filtering and dripping into dry passages over thousands of years, forming amazing cave decorations of stalactites, stalagmites and columns.