You know, I've known about companion planting for many years, and haven't gone "Whole Hog" with it in my gardening. And I haven't met anyone who has been 'into' it to the point they had a fully integrated garden. Hmm, many books written.
I read someplace that legumes do fix nitrogen in nodules on their roots but it's not available to other plants until the legume has died. Kind of makes sense, once you think about it. The companions would have to be parasites to get their sustenance from a living plant.
The nitrogen fixing will enrich the soil in the next season, as those roots break down.
There are other ways that those plants can be beneficial to each other.