This is probably one of the most common questions in polyculture, and the honest answer is “it depends on what you're planting.”
Competition: You plant two pumpkins in the same hole, or two courgettes together. That’s not companion planting, it’s a battle between the two plants on your allotment. Both are heavy feeders, wanting the same water, nutrients, and soil depth; they gradually grind each other down, leaving you with two weak plants instead of one strong one.
Symbiosis: This is when planting two different seeds works well together. Sweetcorn, for example, sends roots straight down, whilst squash sprawls just beneath the surface. Grow them together, and they won’t interfere below ground, as the squash shades out weeds above it and the corn stands tall. Plants that occupy different soil layers, reach different heights, or peak at different times are natural companions.