The above is entirely correct. Plants don’t know anything, and evolution doesn’t follow a plan. The orchid didn’t go “okay, we’re going to start evolving this new shape” and set out along a path to do it. Evolution is one step at a time, random mutations cropping up that happen to pose a slight advantage, until enough stack up to change the species.
This post talks about butterflies evolving eyespots, but the principle is the same, and it’s a good explanation. https://bunjywunjy.tumblr.com/post/649202599235567616/how-to-organisms-know-what-to-mimic-like
What happened with this orchid was likely that the flower happened to bear a very slight resemblance to a female bee, which caused male bees to very occasionally bumble into them. Any flowers that had a tiny bit more resemblance to a female bee had a tiny advantage, and those tiny changes stacked up over hundreds (if not thousands) of generations, until it was a near-perfect lure.