
Thanks to their unique ability to use nitrogen from the air to synthesize proteins they quickly became a very important supply for humans and mammals of protein were meat was scares.
How do these plants do it ...
They do it by establishing a symbiosis ( if you watched spider man 3 .. you saw a symbiotic creature... :) ) between a soil bacteria and their roots. The bacterias are called nitrogen fixing

In the nodule the bacteria gets exposed to air. And as you might know our atmosphere contains 75% Nitrogen.
Without getting into biochemical terms what the bacteria does is grab the nitrogen give it to the root of the LEGUME and the legume gives it some carbohydrates or sugars to grow ..... and they both are happy ...
If you wan to learn more let me know :)