Stalactites and stalagmites are formed in caves through the process of mineral deposition. Water containing dissolved minerals, such as calcium carbonate, drips from the ceiling of a cave. As the water drips, some of the minerals are left behind and gradually accumulate, creating a buildup that eventually forms a stalactite hanging from the ceiling.
Simultaneously, the water that drips onto the cave floor leaves behind more minerals, causing a stalagmite to grow upward from the ground. Over time, these formations can grow quite large as the mineral deposits continue to accumulate.