Natural selection is not intentional. Everything is moved by game theory. Many options are created randomly and then depending on conditions are being selected. Plants mutate randomly and produce different flowers. Bees then select them, randomly too. The bees that survive pass their taste to offsprings. So, bees with good taste thrive, as well as flowers that taste good.
This mechanism is wery well researched and documented, so read more...
I don't understand which part is not logical or seems impossible to you 🤔