Our bodies need protein, and proteins contain nitrogen. The air we breathe has plenty of nitrogen to satisfy our needs. But-that nitrogen is not available to us directly from the air. The only way we can get nitrogen is from the plants we eat, or from the animals we eat that eat the plants.
Here's The Problem...
A nitrogen molecule in the air consists of two atoms which are held together very tightly. In order for us to absorb nitrogen, the two atoms must be separated. But the two atoms are held together so tightly that our body chemistry does not have enough energy to process them.
This is where lightning comes in. Obviously we don't have to be struck by lighting in order to satisfy our need for nitrogen!
However, in a thunderstorm there is enough electrical energy in lightning to separate the nitrogen atoms in the air. Once the atoms are separated they can fall to earth with rain water, and combine with minerals in the soil to form nitrates, a type of fertilizer.
The nitrogen-containing nitrates in the soil are absorbed by the plants, and when we eat the plants or the animals which eat the plants, we get the nitrogen in a form which our bodies can use.
So, in addition to providing a spectacular light show, and scaring us to death, lightning also helps fertilize the soil.