In the form of a gas, nitrogen is useless to plants and animals. Only in the nitrate form can plants absorb the nitrogen they require.
Lightning forms some nitrates.
The resulting nitrates are absorbed by the roots of plants for use in the production of proteins. The tissues of plants use the nitrogen atoms to produce amino acids, which are then built into the proteins. Animals, in turn, get the nitrogen that they need to make proteins by eating plants or other animals. When the plant or animal dies, decomposing bacteria and fungi cause the body of the plant to decay. Nitrite bacteria convert this poisonous ammonia into nitrate molecules, and other nitrate bacteria add a third atom to nitrites to form nitrates.