A cave is a natural opening, usually, in mountains, that is large enough for human entry. I will write about three different types of caves: volcanic, glacier, and solution.
Solution caves form in limestone and gypsum and are the most common type of caves in Texas. These are formed by water that eroded large areas in limestone.
Lava tubes are a form of a volcanic cave. As the lava is emitted from the vent area, it spreads in the path of least resistance shaping a round tunnel.
Most glacier caves are started by water running through or under the glacier. Heat transferred from the water can cause sufficient melting to create an air-filled cavity.
There are other types of caves like erosion caves and crevice caves. Caves are important because they let us observe subterranean processes up close.