The short explanation: Living things need some amount of nitrogen, for use in various proteins. There’s nitrogen all around us, in the air, but it’s all in molecules of N[sub]2[/sub]. Nitrogen really, really likes to be in the form of N[sub]2[/sub], which means it’s really hard to convert it to any other form (like, say, part of a protein). The two main ways nitrogen gets converted to any other form are by some very sophisticated bacteria (which tend to grow in the roots of certain plants like beans), and by lightning. Lightning isn’t very efficient or sophisticated, but there’s a lot of power in lightning, so it doesn’t need to be.
Incidentally, the fact that nitrogen likes to be in the form of N[sub]2[/sub] explains why nitrogen gas is so inert, despite the fact that most explosives contain nitrogen. The nitrogen in, say, TNT doesn’t like to be in that form, and it’s really eager to turn into its N[sub]2[/sub] form. So eager, in fact, that when it does so, it’s a big explosion.