Why do some flowers have a fragrance? Explaining the reasons behind how floral fragrance forms

Floral fragrance comes from oil cells or glycosides.
The fragrance of a flower comes from oil cells in its petals, which continuously secrete a scented aromatic oil. Because aromatic oil evaporates easily, when the flower blooms, the aromatic oil disperses together with water, and this is the floral fragrance people smell.
In nature there are also some flowers that, although their petals contain no oil cells, still give off waves of fragrance when smelled. It turns out that their cells contain a substance called glycoside. Glycoside itself has no fragrance, but when it is broken down by enzymes it can also release a fragrant scent.
Different flowers differ in their ability to secrete aromatic oil and break down glycoside, and this is why some flowers have a strong fragrance while others have a light one. Generally speaking, white flowers and pale yellow flowers have the strongest fragrance, followed by purple flowers and yellow flowers, while light blue flowers have the faintest fragrance. But there are exceptions; for example, white peony is not as fragrant as purple rose, because the strength of floral fragrance is also related to the variety of the flower.
Floral fragrance is a need for reproduction
Some flowers are more fragrant under sunlight, such as the sunflower. Some flowers give off a strong fragrance only on cloudy and rainy days or at night, such as night-blooming jasmine and gardenia. Why is there such a difference?
Because it is a need of the plants themselves for the flowers of various plants to give off different fragrances. In a word, they all do so for the need to reproduce and pass on their kind, and it is all the result of adapting to the environment. Fragrance can attract insects, and the insects play a role in spreading pollen on the flower's stamens, achieving the purpose of pollination, seed setting and passing on the generation.
So we should understand: flowers do not bloom for people to admire, and flowers are not fragrant for people's comfort.
Not all flowers are full of fragrance
Most people think all flowers are full of fragrance, right? Actually, that is not the case. It is said that there are more than 200,000 species of flowering plants on Earth, but the flowers that can give off fragrance make up only a small portion, and not all flowers in nature are full of fragrance. Moreover, for any kind of flower, it is rare to have color, fragrance and charm all together, and a very small number of flowers even smell bad; for example, the flowers of houttuynia cordata smell very bad.