So it makes sense that the goldenrod would have evolved a way to figure out if gall-forming flies were nearby. But the flies, knowing the plants might sense their arrival, also assess the goldenrod. If the goldenrod is exuding volatiles that indicate it has put up anti-fly defenses, the female flies that carry the eggs take notice and avoid it. It’s better, for the fly, to move on in search of a less-defended specimen.