Friday 29 July 2016 was a sultry evening in New York City, rounding out an oppressively sticky month. Yet residents of the five boroughs flooded to a sweltering greenhouse in the Bronx in their thousands. They were determined to see a putrid-smelling flower in the throes of its brief but spectacular reproductive display.

Amorphophallus titanum – which translates as "giant misshapen penis" – holds the record for the world's largest unbranched inflorescence (flowering structure). Hardly any of these plants exist in cultivation, and their blooms are rare and unpredictable, occurring fleetingly once every five to 10 years.

These are crowd-commanding credentials for sure. But probably most of the people racing to the New York Botanical Garden that Friday went to experience the infamous stink: the sharp smell of decomposing flesh, released during the peak of the 24-36-hour bloom. This powerful pong gives the plant its popular name: "corpse flower".

By the time the display ended, 25,000 visitors had gleefully subjected themselves to the monster stench while posing for souvenir selfies. Another million gawkers tuned in to watch the livestream. The New York Botanical Garden, whose last A. titanum bloom occurred in 1939, declared the specimen "a horticultural jewel 10 years in the making".

But then, a couple of days later, corpse flowers bloomed in Indiana, Florida, North Carolina, Wisconsin and the District of Columbia. Three days after that, a plant in Colorado joined them, followed in quick succession by blooms in Missouri, Hawaii, Washington state, New Hampshire and Massachusetts. Prior to the year 2000, fewer than 50 blooms had been recorded in over a century of cultivation.

Just what is going on?

Amorphophallus titanum, discovered in 1878 by Italian botanist Odoardo Beccari, is native to Sumatra, Indonesia.

Its inflorescence consists of a fleshy yellow-green central spike called the spadix that stands over 2m tall, enrobed by a ruffled leaf-like cape called the spathe. Nestled at the base of the spadix, several hundred tiny female flowers grow in a ring below a band of thousands of their tiny male counterparts. During the bloom, the spathe unfurls to reveal a crimson, velvety inner surface and the putrid smell fills the air.

The chemistry of the bloom raises its temperature to over 36C

What does it smell like exactly? Chemical analyses of the scent have identified compounds including isovaleric acid (cheese, sweat), dimethyl disulphide (garlic), dimethyl trisulphide (decomposing meat), indole (faeces) and trimethylamine (rotting fish). The foetid fragrance appears in the late evening, intensifies into the night and gradually tapers off as morning breaks.

The striking red interior and smell are both facets of an artful illusion designed to entice pollinators. According to Amorphophallus expert Wilbert Hetterscheid of the Von Gimborn Arboretum in Doorn, the Netherlands, the primary candidates are small nocturnal carrion beetles searching for freshly-dead meat to lay their eggs in.

On top of raising a stink, the chemistry of the bloom raises its temperature to over 36C – human body temperature – perpetuating the illusion of decomposing flesh and helping to disperse the volatile compounds through the dense tropical forest.

This also accounts for the plant's gargantuan proportions. Since A. titanum is not a self-pollinator, it can only reproduce if beetles and other insects shuttle pollen between blooming individuals. The spadix and spathe act together as a kind of olfactory loudhailer, luring pollinators from far and wide.

As you might imagine, producing such a colossal bloom comes at a huge energy cost to the plant.

Energy is provided by its corm – a swollen, starchy storage root weighing up to 100kg. During non-flowering years, the corm sends up a single enormous branched leaf which, at 3-4m tall, looks more like a small tree. It takes several years of diligent photosynthesising for the plant to gather enough energy to bloom, and even then it can only maintain the bloom for a brief 24-36 hours before the whole thing collapses.

The bloom actually occurs in two stages over consecutive nights. On the first, pollen-carrying carrion beetles dive to the bottom of the inflorescence and deposit pollen on the receptive female flowers. The abundance of food, along with a slippery coating secreted by the spathe, "keep them in the kettle for a while," according to Hetterscheid.

We are finding that it takes on average 10 years to reach flowering stage

The male phase of the bloom occurs around 24 hours later, and at this point the artifice crumbles.

The fragrance fades, the spathe oils dry up, and the tricked insects exit. As they do, they brush past the now pollen-shedding male flowers, ideally heading off towards the scent of a female-phase bloom occurring nearby.

The brevity of the bloom is certainly a persuasive reason for why some method of synchronised flowering could be of benefit to the species.

"When you have a flower that only lasts a couple of days, it's such a narrow window of opportunity," says Marc Hachadourian, greenhouse director at the New York Botanical Garden. "Some kind of trigger for the plants to bloom in the wild would ensure you have more than one individual flowering."

As for what exactly triggered the spate of blooms in 2016 – there were at least 32, mostly in the US but also in India, Australia, Denmark, Belgium and the UK – one theory is that the plants could all be reaching maturity at the same time.

According to Emily Colletti, an Amorphophallus specialist at the Missouri Botanical Garden, many of the individuals in cultivation today are second-generation descendants of seeds distributed widely in 1993 and 1995, making them cousins. "We are finding that it takes on average 10 years to reach flowering stage," she says. This timescale would explain the marked uptick in bloom numbers since 2013.

Many species of plant – from bamboo to orchids – undergo mass simultaneous flowering events

However, Hachadourian hesitates over that theory. "I've talked to some of the other botanical gardens and I can't seem to find a link that they all came from the same seed source," he says. Nevertheless, the wide distribution of seeds, no matter their progenitors, might be a factor at play.

London's Kew Gardens, which saw 11 corpse flower blooms in the period 2005-2009, as well as one in April 2016, credits in equal measure their expanding collection and their horticulturists' enhanced understanding of how to best care for the plants.

Another theory, says Hachadourian, is that the especially warm, dry and extended summer in the north-east US could have set the stage for a mass bloom there in 2016. Many species of plant – from bamboo to orchids – undergo mass simultaneous flowering events, he explains.

"Each species has different factors that control these events," says Hachadourian. "Some may be due to changes in climate, their environment, cycles of the moon, a response to temperature, or in some cases mass flowering after a fire."

But research on the corpse flower is still in its infancy. Given the many months these plants spend preparing to bloom, "a lot of footwork" would be required to collect enough retrospective data to indicate a correlation – let alone a causative relationship – between climate and corpse flower blooming.

"At this point," says Hachadourian, "only the plants know for sure."

Join over six million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly 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.