Because we eat the leaves (or some variation) and they take a while to mature, they’re ideal companion plants for onions.
Carrots make good onion companion plants for the same reason. The smell of onions deters the carrot fly by masking the carrot’s smell.
You can plant lettuce while the onions are still bulbs and harvest it before they need the soil space. Also, lettuce has shallow roots, so won’t compete for nutrients or room.
Mint works the opposite way as a companion plant for onions, but for the same reason. Its strong aroma repels the onion fly, which eats onions.
Marigolds help attract pollinators to gardens but also prevent nematodes from settling in the soil. It’s only the second thing we’re interested in when planting alongside onions.