Hidden in plain sight, just minutes away from the bustle of New Delhi’s commercial hub, Connaught Place, is an ancient landmark unknown even to most locals.

Agrasen ki baoli is a 14th-century stepwell (known as baoli or baori), a unique architectural idea that was medieval India’s ingenious answer to perennial water shortage. By creating enormous wells deep below ground, accessed by steps going down as far as 30m, these sophisticated water reservoirs tapped into difficult-to-reach underground water tables, providing a year-round water supply to locals.

As I stood at the top of the 104 steps descending into the depths of the Earth at Agrasen ki baoli, I could see the high-rise city buildings in the backdrop, their white facades presenting a stunning contrast to the russet bricks disappearing into the dark. The steps were enclosed on three sides by tall walls decorated with arches, niches and passageways, none of it giving any idea of what lay underground.

American art historian and archaeologist Victoria Lautman, author of the upcoming book The Vanishing Stepwells of India, described the sensory overload of her first descent into a stepwell: “The contrasts were so pronounced, all my senses were activated: bright light became murky dark, intense heat became cool surrounding air, and the incessant din above-ground became hushed – the deeper I went the more everything transformed.”

While stepwells are largely to be found in the arid north and west of India, they are not unique to those regions. In the country’s south, they take on the form of temple tanks (locally known as kalyani or pushkarani), which fulfilled essentially the same function.

India’s oldest stepwell is believed to date to 600 CE, although most of those still standing were built after the 10th Century. Stepwells proliferated in public areas in towns as well as along important trade routes, and were open for use by the entire community. As such, over time they became a social hub for travellers and for women, who would come to fetch water each day, with fine architectural and design elements incorporated into the basic structure: think graceful arches, handsome pillars and ornate carvings.

Divay Gupta, a leading conservation architect and head of the Architectural Heritage Division of INTACH (Indian National Trust for Art and Cultural Heritage), described them as “magnificent in their conception, their architecture and ornamentation, no less so than the temples and palaces of their times.”

One of the grandest, the Unesco-listed Rani ki vav (vav is the local word in the west Indian state of Gujarat), was built in the 11th Century by the queen Udayamati as a gift to her people. On a cool winter morning, I explored five levels of this massive stepwell with guide Bhupendra Jadeja. Rani ki vav originally goes seven floors down, but the bottom two are currently closed to visitors due to recent earthquakes.

As I took in the exquisite statues lining the walls and supporting pillars, Jadeja shared an interesting use for these places. When women from all over the area congregated at the well, they would exchange gossip about their lives and livelihoods, which was picked up and passed on to the king by his informers: an easy and efficient intelligence network.

Many stepwells, as is to be expected in India, have legends of love and valour associated with them. The most tragic of these is around the Adalaj ni vav near the city of Ahmedabad in Gujarat. The story goes that in 1499 the kingdom was conquered by the Muslim ruler Mohammed Begda, who killed the Hindu king Rana Veer Sinh and fell in love with his beautiful widow Rani Rudabai. Rani Rudabai demanded that Begda complete the work on the stepwell begun by her husband in return for her hand in marriage.

And so Adalaj ni vav took shape, a work of love expressed through its amalgamation of Hindu-Islamic styles, with intricate carvings and statues reaching five levels into the ground. When the vav was proudly presented to the loyal queen, she inspected it and then drowned herself in the waters.

Although echoes of the story have faded with time – with even many locals unaware of the site’s rich history – Adalaj remains one of the most beautiful stepwells in the region.

Just 100 years ago, there were close to 3,000 of these fascinating reservoirs scattered across water-scarce regions of India. However, as a result of diminishing underground water tables, due to a growing population, and the movement towards private water sources such as taps and tanks, stepwells have fallen into disuse. British rulers also deemed stepwells unhygienic and breeding grounds for disease, filling them up with mud or sealing them off from the public.

Today, many of the remaining ancient stepwells are neglected and dilapidated; some even used as rubbish dumps. In many cases, entire communities are unaware of the existence of an old stepwell in their area or simply do not consider them significant in any way.

As Bharatbhai, the tea-seller near Rani ki Vav told me with a dismissive wave of his hand, “Yes, many tourists come here these days, but the vav is all toota-phoota (broken), so I can’t really understand it.”

However, despite all the dereliction, some of the better-preserved stepwells are starting to become tourist attractions. And justly so. For these examples of beautiful architecture, as well as of clever and sophisticated engineering, could be relevant again today, with India regularly facing the spectre of drought over the past few decades.

“[Stepwells] could still be relevant in storing water, which is becoming very scarce and also in improving ground water table,” Gupta told me.

Perhaps, there is still a future for the ancient baoli.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.