They’re fantastically useful insects for all but a few weeks at the end of summer. They are carnivores. They hunt down and kill other insects, such as gardener’s pests, like aphids (and they also feed on carrion). They take them back to their nests to feed the young.
At the end of the year, their brood has hatched and the queens throw out the workers and the adults fly around without any real purpose, so they feed on whatever sugary stuff is available. That’s when they tend to wander around getting grumpy and bad tempered, and being a darned nuisance around your barbecues and outside seating areas. Until then, wasps are a very helpful animal. If you find a queen wasp near the house, let them be because they’re going to be helpful in the garden eventually.