Atmospheric nitrogen exists as a highly stable, unreactive diatomic molecule. It's made bioavailable either by the action of lightning or bacteria. Lightning causes nitrogen to react with oxygen to form nitrogen oxides. These oxides dissolve in rain to form a dilute solution of nitric acid, which converts to nitrates in soil. Although nitrogen can't be directly absorbed by plants, some bacteria that live in the roots of plants can directly convert atmospheric nitrogen into nitrates. These bacteria are called "nitrogen-fixing bacteria" and live in the roots of plants from the pea, bean and clover families. Nitrogen-fixing bacteria also live freely in soil.
Nitrates are readily absorbed from soil by plants, which convert them into amino acids and proteins. Herbivorous animals such as cows and sheep then absorb these proteins when they eat the plants, with plant proteins converted into animal proteins. Meat-eating animals then take in these proteins when they eat the plant eaters. Omnivorous animals, such as human beings, get their nitrogen from both plants and animals.
When animals and plants die, their bodies are broken down by fungi and bacteria to form ammonia compounds. This ammonia is then fixed by "nitrifying" bacteria, converting the ammonia into nitrates that are once again absorbed by plants. Ammonia is also present in animal waste, which is why manure and decomposed plant matter, compost, is used by farmers to fertilize crops. Commercial fertilizers also contain high concentrations of ammonium nitrate, which is readily absorbed by plants before and after the action of nitrifying bacteria.
The final stage of the nitrogen cycle is the conversion of biological nitrogen compounds to nitrogen gas, which then returns to the atmosphere. This is done by a third type of bacteria, called "de-nitrifying" bacteria. As the name suggests, this type of soil bacteria lowers the concentration of nitrates by reducing them back into diatomic nitrogen. The liberated nitrogen returns to the atmosphere ready to be re-absorbed.