From putrid corpse lilies to perfumed petunias, flowers expel a diverse range of scent molecules into the air. But flowering plants don’t release these odors for the benefit of human noses. Flowers use their scents to attract pollinators, communicate with other plants and for some carnivorous species, lure in food.

More than a thousand years ago Persian physician Ibn Sina discovered how to distill roses into aromatic oils. He placed the flowers in a heated chamber to create a vapor of scented oil and water; after the steam condensed Ibn Sina collected the oil that floated to the top of the watery mixture. Until the past few decades, however, the biochemical process of scent production remained a mystery. In 1953, chemists knew of 20 chemicals in a rose’s fragrant bouquet; by 2006, they had discovered roughly 400. To date, scientists have catalogued 1,700 different scent compounds produced by flowers. Some plant odors are brews of more than 100 compounds, says Natalia Dudareva, a biochemist at Purdue University.

“Scent is a complex mixture of low molecular weight compounds,” says Dudareva. Each scent compound is an organic molecule known as a volatile, a chemical that vaporizes into a gas when released by a plant. These chemicals are miniscule – so small, in fact, that if the average American had the same mass as the moon, the heaviest odor molecule would have the mass of a marshmallow. The tiny size of the molecules allows the compounds to evaporate into the air, where the olfactory organs of insects or bats can sense the odor.

Like all organic chemicals, each odor molecule has a spine built of carbon atoms. What makes floral scents distinctive are the length of the carbon chains and the other types of atoms glued to these backbones. Sulfur atoms embedded among the carbon chains give carrion flowers, which smell like excrement or rotting flesh, their characteristic stink.

The part of the plant that releases fragrance depends upon the species. For many flowering plants, the production of odor is not confined to one area, but is spread throughout the outer layer of petals and other parts of the flower. But some flowers, such as orchids, have specialized scent glands called osmophores that ooze liquid scent, which evaporates on contact with the air.

Unsurprisingly, many flowers emit scents to aid reproduction. Some flowering plants are generalists and use their odors to entice a host of insects and birds to fertilize their flowers. Others specialize, releasing scents that only appeal to a particular insect. The Soaptree yucca, for example, emits an aroma that attracts a single, aptly named species of yucca moth. As pollinators travel from flower to flower, they collect and deposit pollen, fertilizing the plants.

The creation of scent is a balancing act: plants must generate enough smell to induce insects to fertilize their flowers, but not so much that they waste energy and carbon. In fact, for many species, scent emission is not constant; snapdragons decrease scent production 36 hours after pollination.

Many flowers offer a reward to pollinators in the form of nectar or nest-building materials; fragrances signal to animals that such incentives are available. The sweet smell of honeysuckle beckons butterflies with promises of nectar. Like the creation of scent, nectar production costs the plant resources and energy. Some flowers have evolved to exploit this symbiosis, mimicking the scents of other flowers but giving no benefit to pollinators. The European centaury, for example, emits an odor that attracts foraging insects, but offers no food.

Not only can plants mimic other plants, but some flowers mimic animals. The flower of the bee orchid smells and looks, to the male bee, just like a female bee. The duped male bee attempts to copulate with the orchid’s petals, and the insect spreads pollen between the deceptive flowers. And flowers don’t just imitate bees. A few orchid species smell like female flies, and others replicate the aroma and texture of scarab beetles.

Researchers such as Purdue’s Dudareva study petunias as models for odor-producing flowers. Current biochemical studies are uncovering the processes by which these plants create amino acids, chemicals used in the production of volatile scents. Aromatic amino acids aren’t just precursors to plant fragrance. Some, such as tryptophan, are essential for protein production in animal cells. By studying the ways plants craft odor, scientists learn about the creation of molecules that sustain all forms of life.

To this day, the flowers that Ibn Sina distilled a millennium ago – damask roses – are the single most important plant species used in perfumery. A few perfumers still use Ibn Sina’s steam extraction technique, albeit modernized, to obtain scents. But the most common method employed today requires submerging flowers in chemicals such as benzene, which disintegrates plant matter but leaves behind the aromatic oils. Once extracted, rose oil can supply a perfume’s entire fragrance, or the oil can be one ingredient in a mix of hundreds.

Flower volatiles can do more for humans than just cover up stink. Caregivers who practice aromatherapy apply flower oils to stop everything from headaches to the lasting effects of torture. But a few doctors, such as psychiatrist Stephen Barrett, dismiss this field as a pseudoscience, citing aromatherapy advocates who make unverifiable claims. In 2008, a team of Australian clinical neuroscientists reviewed the scientific literature regarding aromatherapy. The researchers found that support for aromatherapy was limited, but certain studies showed promising effects, particularly in reducing stress.

In other words, stopping to smell the roses just might put a mind at ease.