some of these bacteria live in the roots of plants (mostly legumes). in these roots, they make ammonia for the plant and the plant gives them carbohydrates. other plants take nitrogen compounds out of the soil through their roots. all nitrogen in animals comes from eating plants.