The work of groundwater is responsible for the formation of stalactites and stalagmites.
In areas of limestone, the alkaline water seeps through the roof of the limestone caves.
When this water evaporates, minerals get deposited at the bottom and at the top of the limestone caves.
This leads to formation of stalactites and stalagmites.