You would think that humans would want to steer clear of the corpse flower when it blooms. After all, the plant releases a stench of rotting dead animal when it opens.

Still, visitors flock to botanical gardens for the chance to catch a whiff. Considering that corpse flowers bloom for only 24 hours every two to 10 years, the opportunity to be there for a rare, if smelly, event is a hard one to pass up.

The odor the corpse flower releases is supposed to be alluring only to certain insects. It's part of an elaborate deception the flower engages in so that it can reproduce.

Smelly bloom

The actual reproductive parts of the corpse flower are deep inside the plant. Duncan Reddish/Royal Botanic Garden Edinburgh

After growing up to 10 feet, the corpse flower unveils two different components that are key to its survival.

The first is the spathe, a burgundy-colored "skirt" that resembles a very large circular petal. In fact, it's actually a modified leaf that, according to KQED Science, looks like raw steak up close. It also releases an aroma similar to jasmine, making for an odd combination of sight and smell.

The second part of this elaborate ruse is the spadix, a yellow rod-like structure that gives the corpse flower its scientific name: Amorphophallus titanum, or, roughly translated, "giant deformed phallus."

Both parts play a role in the corpse flower's reproduction. The spathe provides what looks like the red guts of a dead animal, while the spadix helps to warm the flower so as to better diffuse the stench. These effects attract would-be pollinators, insects that like to lay their eggs inside rotting animals.

From the base of the spathe, more than 30 chemicals are released over the course of blooming, shifting from sweet to "dead rat in the walls of your house," Vanessa Handley, director of collections and research at the University of California Botanical Garden in Berkeley, told KQED Science.

Rows of male flowers (yellow) and female flowers (orange and purple) inside a corpse flower that opened up at the University of California Botanical Garden. Josh Cassidy/KQED

Neither part is where reproduction occurs. For that, you have to go deep inside the plant to find male and female flowers.

At the base of the bloom are male flowers that look like corn kernels and female flowers that look like small bulbous stalks. When the corpse flower opens, these female flowers are ready to receive pollen from another corpse flower. They become sticky so as to trap the pollen grains carried by insects thinking this is a good place to lay their eggs.

A fly explores pollen-producing male flowers inside a corpse flower. Hopefully this fly will carry the pollen to another corpse flower. Josh Cassidy//KQED

After this period, the male flowers begin to release stringy pollen that will, hopefully, be picked up by the insects and carried to another corpse flower.

"They fumble around and leave, and in the best-case scenario they're covered in pollen that they carry to another receptive plant," Handley said.

If some of the string pollen from the male flowers falls onto the female flowers, it's not a big deal. By that point in the process, the female flower is no longer sticky and isn't trapping pollen. It wants fresh genetic material, after all, not material from itself.

Conserving the corpse flower

Of course, when corpse flowers are in a botanical garden, their odds of reproducing are lower than they would be in the wild. Often, no other plants are open at the same time. So biologists may need to lend a helping hand.

Scientists can cut a hole in the side of the flowering base and scrape the stringy pollen from the male plants with a metal spatula. This pollen is frozen and is later used to pollinate another corpse flower somewhere else. Scientists don't do this too often, though. It's not good for the plant.

"This might cause the plant to put all its energy into its seeds," Ernesto Sandoval, of the UC Davis Botanical Conservatory, told KQED, "and the plant itself dying."

Such efforts are needed once in a while, though. The corpse flower, given its unique appearance and rare blooming scheduling, makes it a popular poaching target in its native Sumatra. Deforestation on the large Indonesia island also threatens the survival of the plant.