Plants often grow better when ammended with N fertilizer. The reason why the biosphere is limited by nitrogen is that there are few ways to convert N2 gas in the atmosphere to plant available forms. Lightning can create a tiny fractions of NH4 and NO3 required by plants. They harbor a symbiotic bacterium, Rhizobium, in their roots that are capable of breaking the strong N-N triple bond and creating NH4 using the enzyme, nitrogenase. Nitrogenase is extremely sensitive to O2 and it becomes inactive in it's presence.
Legumes are a critically important functional group in ecosystems.
They are often common in early successional sequences following disturbance when soil N levels are low and infertile. The colonization of legumes may buildup the soil N pool so that other species are able to colonize. A scary example of this is the invasive tree species, Myrica , in Hawaii. What's cool is that the bacterium gets carbon in the form of photosynthates from the plant. These are hotly studied questions.