These are bacterial root nodules on the root of runner bean Phaseolus coccineus. Each nodule contains a population of Rhizobium bacteria that are capable of converting atmospheric nitrogen into soluble forms of nitrogen that the plant can use for growth - which is what makes this symbiotic association between plant and bacterium so valuable for agriculture. In annual legume crops, once the bean crop has been harvested the root nodules decay and release nitrogen in the soil, where it can give a yield boost to following non-legume crops in the crop rotation - like wheat, for example.
In this image one of the nodules has been cut in transverse section and stained with the fluorochromes calcofluor and auramine O. The plant root, with its xylem vessels visible, is at the top. The bacteria filling the root nodule, encased in blue-stained plant cells, are stained yellow. The Rhizobium bacteria in the soil penetrate through a root hair, trigger proliferation of the host plant root cells to form a nodule and multiply within. Healthy root nodules are pink when you cut them open due to the presence of leghaemoglobin which, like haemoglobin in mammalian blood, absorbs oxygen. This is important because oxygen would otherwise inhibit the enzymes in the nodule that 'fix' nitrogen into soluble forms. Bacterial nodules that are not pink when you cut them open are likely to be parasitic on the host plant, rather than symbiotic.
This is the difference that nodulation makes. The plant on the right has effective nodules, the one on the left doesn't. The interaction between plant and bacterial strain is complex; for any give crop cultivar, different bacteral strains will show varying degrees of effectiveness in boosting crop yield and different crop varieties perform best with different bacterial strains. Deliberately inoculating seeds with effective Rhizobium strains can produce significant yield benefits, although there is no guarantee that any particular inoculum will persist in a soil type or location where it's not a naturally-occurring strain amongst the existing soil microbial community.