Will you be growing marigolds under your marrows this spring? What about garlic or onions among your greens, or basil with your beans? Companion planting it's called by some; for others, myth and magic would be more appropriate.
I am sort-of in the latter category, at least if this co-planting stuff is based only on rumour, passed down over generations of gardeners. For example, think of an onion bed. It does not actually have an oniony smell until harvest time, when all that lifting of these beautiful golden bulbs, and, in my case, trampling by my size 12 gummies, damages leaves and roots, only then releasing those characteristic, pungent organosulphur compounds. These chemicals (which are in garlic too) help fight colon cancers but whether they keep the white fly off your tomatoes is another matter entirely.
What definitely does work is the fact that many flowering plants do provide a lot of Snap for the garden's good guys. Shelter, Nectar, Alternative food and Pollen are the basis of this acronym and, when I ask about it in a student exam paper, everybody answers that question. Lots of marking for me as a result, but if it enhances learning, I'm happy. A "tidy" vege garden, with all trace of weeds removed, is a bit of an ecological desert, with low non-crop diversity and a not very "snappy" environment.
The good insects (and spiders), which help us reduce aphid numbers on the cabbages and keep caterpillars at manageable levels (meaning that you may, however, still have to pluck a few off your broccoli) all need pollen for protein. This helps the female ladybird make hundreds of eggs, which hatch into black and orange larvae, each of which can eat 30 greenfly a day. Hoverflies too, which mimic wasps but are harmless, hover over flowers and gorge on nectar for the energy they need for all that hovering. They too need pollen for protein. I suppose we could leave a few flowering weeds around the place; non-pest aphids live on them, providing the "A" of Snap, but that's a bit random too.