How can a plant knows how something looks like?
Many years ago, a mutation in a plant made its flower a similar colour to a certain species of bee.. It got more hits (99/100 hits for pollen/nectar, 1/100 hits for randy male bees with bad eyesight).
Thousands of generations later, a mutation in one of that flower's descendants made its flower a slightly similar shape to the same species of bee.. It got more hits (90/100 hits for pollen/nectar, 10/100 hits for randy male bees)
Thousands of generations later, a mutation in one of that flower's descendants coded for a flower with nice sexy lady bee proportions, which resulted in more hits (99/100 randy male bees, 1/100 pollen/nectar requests)......
Congratulations! You now have a successful new species of orchid!