Some flowers are known for their pleasant odor. Some of the strongest odors are produced by the flowers of angiosperms (flowering plants). Angiosperm fossils date to 125 million years ago to a time when dinosaurs still roamed the earth. Most plant odors are not directed at humans. They are directed at insect pollinators.
The angiosperms are the most successful of the existing plant groups both in numbers of species and total biomass. A distinct advantage for angiosperms over other groups of plants is a precise system for pollination. Most angiosperms depend on insects for pollination. The pleasant odors we associate with flowering plants are the same odors that the plants use to attract bee and butterfly pollinators.
However, not all species of plants are pollinated by bees. Some plants are fly pollinated. Odors that attract flies often mimic rotting animals that humans find repugnant. The largest flower on record is a corpse flower, Amorphophallus titanum. that is 10 feet 2.5 inches wide and weighs over 300 pounds. As the name implies, the flower produces the same odor as a dead body, or corpse. Some people keep corpse flowers in hopes of getting a world record or to impress their friends with the spectacular blooms. The odors of corpse flowers attract flesh flies (Sarcophagidae) and carrion beetles that can serve as pollinators. World records aside, a plant that mimics the odor of a rotting corpse is not an ideal house plant.