A cave is an air- or water- filled void beneath the ground, where there is insufficient rock to prevent human access.
They can be formed by
- acidic rainwater, eroding away large of rocks such as limestone.
- lava cooling and solidifying - either in bubbles, or when the crust of a lava flow solidifies, while the still-liquid lava underneath moves on.
- waves - on coasts, waves can pound out caves in cliffs.
- erosion from wind or water