Rhizobia are Gram-negative soil bacteria which grow inside the root nodules of legumes (the pea family: Fabaceae).
The growth of this bacteria is beneficial to their plant host. They fix (absorb and chemically change) nitrogen from the air and convert it into the chemical ammonia (through the help of enzymes). The host plant breaks down this ammonia and uses it for growth.
In return, the plants provide the bacteria with nutrients for growth from products of plant photosynthesis.