Most caves form in karst, which is a type of landscape composed of dolomite, gypsum and limestone rocks that gradually dissolves in the presence of slightly acidic water, according to National Geographic. Some caves are found in cliffs at the edge of a coastline. Others form in areas where the outer surface of a lava tube cools and hardens, and the molten rock’s inner content drains away.
Caves also form in glaciers where meltwater carves tunnels as it travels to the sea, explains National Geographic. Those that form in karst result from the mixture of rain with carbon dioxide in the atmosphere as rain falls to the ground and obtains more carbon dioxide and seeps into the soil. As more water permeates the earth, the passages become wider, allowing more water to flow through them. Later, some of these passages become large enough to form caves. Most solutional caves take more than 100,000 years to form into a space capable of accommodating a human.
According to the University of Wisconsin-Eau Claire, caves and their features are created when rainwater follows the joints and cracks in a rock material, such as dolomite or limestone. When the rainwater combines with carbon dioxide, a weak acid called carbonic acid forms. Cave formations are created when acid reacts with limestone or a rock with at least 80 percent calcium carbonate. They occur on the ceilings, floors and walls of caves.