Sounds like a no-brainer. It's not that simple. Sweet foods like fruit would also attract honey bees. And orchard owners want honey bees around, because they pollinate the fruit trees. Some yellowjackets like meat, but that rots too fast to make a good bait.
Some chemicals attract the insects too.
But until now, scientists didn't have one that appealed to the five peskiest species of yellowjacket in the United States. He was actually developing a lure to trap codling moths. Landolt tried using various chemicals found in sweet foods like molasses and rotting fruit. Further testing showed that the combination attracted most species of yellowjacket pests, as well as some species of wasps and hornets. Now Landolt is working with a company in Washington state to develop the best container for the chemicals to serve as a trap.