How and why flowers develop their scent?
No two flower species have the same scent although their colour and petal structure may look quite similar.
The purpose of the scent is to lure pollinators. Plant species pollinated by bees and flies have sweet scent while those pollinated by beetles have musty or fruity odours. Large flowers like Rafflesia arnoldii and Titan arum smell like decomposing corpses and the smell attracts their pollinators, the flies.
Flowers give off scent only when their prospective pollinators are most active. Thus plants like the Jasmine that are pollinated by moths and bats bloom at night and emit a sweet fragrance.While some plants emit strong scents to keep animals away, the Venus flytrap uses its scent to attract insects which are then eaten by the plant!