Of all of the gases in the atmosphere, nitrogen gas (N2) is the most abundant. One would think that this would be great for plants and animals as they need nitrogen to build macromolecules like nucleic acids and proteins, but plants and animals cannot use nitrogen in its most common form (N2).
Some plants, called legumes, form symbiotic relationships with bacteria that are able to change the gaseous nitrogen to a form that can be used by plants. Bacteria like Rhizobioum can live in root nodules of legumes like peas, alfalfa, and soybeans. It is a mutualistic relationship because the bacteria benefit as they are given a home and a carbon source from the legume roots and the plants benefit because the bacteria are able to convert the N2 into ammonia and then to organic molecules that can be used by the plants. These legumes and their symbiotic bacteria can be used to add nitrogen to nitrogen-poor soils. Legumes are often planted after corn (which takes a lot of nitrogen out of the soil) in crop rotation cycles.
Denitrifying bacteria do the opposite of the nitrogen fixing bacteria associated with legumes. Denitrification involves converting nitrates that come from nitrifying bacteria back to nitrogen gas (N2).