the mechanism could work only because insects, at the same time, evolved genes that attracted them to flowers. Why did they? Because flowers provide nectar, which is food. Just as there is co-evolution between the genes to coordinate mating behaviours in males and females of the same species, so genes for making flowers and giving them their shapes and colours co-evolved with genes in insects for recognizing flowers with the best nectar.