Companion planting only produces reliable results when the mechanism behind the pairing matches the problem in the bed. There is no general force of plants "liking" each other. What exists is a short list of separable effects — disrupting how an insect finds its host, diverting that insect into a trap crop, feeding the predators and parasitoids that kill it, fixing nitrogen with legumes, and casting shade or lending physical support — and each one carries its own conditions. Name the mechanism first. Choose the plant second.

I'm kneeling at the edge of my 4-by-8 raised bed in mid-June, a flat of French marigolds on the soil beside me, one tomato plant already chest-high. You've probably stood in the same place with a phone open to one of those grid charts. Marigold goes in the tomato box. Basil goes in the tomato box too. The chart never asks what either plant is supposed to be doing.
Here is what finally made the chart useless to me: the marigold pairing isn't nonsense, it's answering a different question than the one I had. Certain marigold species have appeared in land-grant extension guidance on root-knot nematode for a long time — as a cover crop. Grown thick across infested ground for a full season, then turned into the soil, those roots occupy the same soil volume the nematodes do. That's the mechanism: root contact, at scale, over months. One marigold tucked into the corner of a raised bed filled with potting mix shares none of those conditions. Same plant, same chart entry, and the mechanism never fires.
That's the whole problem with copying a friends-and-enemies list. It hands you the answer with the machinery removed. You can't tell a pairing that's doing something from a pairing that's sitting there looking productive.
What each mechanism actually requires
Five mechanisms cover nearly every companion planting claim worth taking seriously. They are not interchangeable, and they don't stack automatically. Each has a condition that has to be met or it does nothing.
Disrupting host-finding
Most insect pests locate a crop by odor plume first and visual silhouette second. Interplanting works by muddying both signals, and it only works if the companion occupies enough canopy or ground area to actually change the profile of the crop. One dill plant next to four cabbage plants doesn't change what the cabbage patch smells like from six feet away. A bed where the companion covers a real share of the leaf area might.
Three placement facts decide whether this mechanism can function at all. Row interplanting beats blocks, because a solid block of one crop still reads as one large host patch from the air. The companion needs to sit upwind of the crop during the flight period of the pest, otherwise the odor plume you're trying to break up never passes through it. And the companion has to be inside the crop canopy, not on the border of the bed outside the crop's leaf zone.
What you get when it works is partial. Colonization drops; it doesn't stop. Insects with weak odor orientation, or ones that find hosts mostly by landing and tasting, barely notice.
Trap cropping
This is a different mechanism wearing the same clothes. You aren't hiding the host, you're offering a better one at the right moment and in the right place. Four conditions: the trap has to be more attractive than the crop while the pest is choosing, it has to be ahead of the main crop in development so pests settle there first, it has to sit where the pest arrives, and it has to be destroyed or treated before the next generation moves off it. That last step is where most home trap cropping fails. A trap crop left standing through the season is a nursery, not a control.
Trap cropping also scales badly downward. On a farm field, a trap border intercepts insects moving in from outside. In a 4-by-8 bed surrounded by other gardens, a trap plant is simply one more thing in a small patch, and it may pull pests toward your plot rather than away from the crop.
Feeding the things that eat pests
This mechanism doesn't repel anything. It raises mortality. Adult parasitoid wasps, hoverflies, and many predatory beetles feed on nectar and pollen, and a bed with nothing blooming is a bed where they arrive hungry and leave. Open, shallow flowers — dill, cilantro, fennel, sweet alyssum, buckwheat — are the ones those insects can actually reach into.
The conditions are stricter than they sound. The bloom has to overlap the pest's active period, not the whole season generically. There has to be prey in the bed, because a nectar source with nothing to eat builds no population. And nothing in the bed can be getting sprayed with a broad-spectrum insecticide, which undoes the whole thing in one application. On an isolated balcony several floors up, this mechanism mostly doesn't fire at all — there's no resident population to feed. It works far better where a larger garden sits nearby.
Legumes and nitrogen
Rhizobia in legume root nodules fix nitrogen for the legume. That's the honest version. Most of it goes into the bean or pea plant itself, and any transfer to a neighboring crop in the same season is small and slow. Extension guidance on nitrogen credits from cover crops makes the distinction clear: a legume cover crop terminated at peak biomass leaves a meaningful credit for the next crop, while a legume growing alongside a cash crop does not.
There's a second detail people miss. In a potting mix already charged with soluble nitrogen, legumes often nodulate poorly. The plant takes the easy nitrogen instead of making the partnership, so the whole mechanism stays switched off. Beans and tomatoes sharing a container are competing for water and root volume far more than they're cooperating.
Shade and support
This one is geometry, not chemistry, and it's the most reliable item on the list because you can see it working. Corn as a trellis for pole beans. A tall crop on the south or west side shading lettuce through the worst of July. A taller companion acting as a windbreak on an exposed roof. Heat-sensitive crops — spinach, lettuce, cilantro — genuinely benefit from afternoon shade from a taller neighbor. The tradeoff is competition: too much shade costs you yield, and plants sharing a bed are sharing water and nutrients whether or not the pairing is on a chart.
Naming the problem before naming the plant
Start by writing the problem as one sentence. "Flea beetle hits my kale every May." "The lettuce bolts by the second week of July." "This bed runs out of nitrogen by August." Then pick the mechanism that addresses that sentence, and only that sentence.
Flea beetle on brassicas: trap cropping can work if the trap goes in early and gets managed; interplanting for host-finding disruption can help a little; row cover outperforms both and isn't companion planting at all. Bolting lettuce: the shade mechanism, straight up. A nitrogen gap: sequence, not pairing. Aphids: a habitat strip for natural enemies, plus tolerance for some aphids, plus accepting that a heavy outbreak is not a companion planting problem.
And if there's no problem — if the bed is producing and nothing is eating it — then plant what you want to eat. A companion you can't assign a mechanism to is decoration, which is fine as long as you're not counting on it for yield.
Placement decides whether any of this functions
The most common failure I see isn't the wrong plant. It's the right plant in the wrong place. A companion in a pot on the far side of the balcony, outside the crop's leaf zone, isn't intercepting anything. A trap crop planted the same week as the main crop isn't ahead of it. A flower strip that finished blooming three weeks before the pest showed up fed nothing. Upwind position, row rather than block arrangement, the companion inside the canopy band, and bloom timed to the pest — those four details carry more of the outcome than the species name on the seed packet.
In a small space, sequence beats pairing anyway
If you garden in containers, a balcony, or one or two raised beds, the single biggest change you can make isn't a pairing at all. It's what follows what in the same pot or the same bed. Prior crop residue, root disease, and pest populations stay on site. Swapping plant families between successions breaks cycles that a companion plant cannot touch. A spring pea crop cut down and left in place feeds the summer planting far more reliably than a bean plant growing next to it. Refreshing the potting mix between crops resets the container entirely, which is something a field grower can't do and you can.
Sequence is unglamorous and it doesn't photograph well. It also outperforms pairing charts in a small plot, most seasons.
What this approach will not do
It won't hand you a chart, and that's the tradeoff. You have to know what the pest is and how it finds your crop, which means looking at the bed more carefully than a chart requires.
It also won't hold up against heavy pressure. When a pest population is high, physical exclusion and treatments labeled for that pest — following extension guidance rather than a home remedy — are what actually work. Companion planting is fine-tuning on top of a garden that's already functioning. Treating it as a control method for a serious infestation is how people end up disappointed and blaming the marigolds.
So the test I use now, before anything goes in the ground: can I say which of the five mechanisms this pairing is supposed to use, and what has to be true for it to work? If the answer is no, I plant it because I like it, and I don't count it as pest control.