The symbiotic bacteria Rhizobium fix atmospheric nitrogen into ammonia in the root nodules present in legume plants. It fixes atmospheric nitrogen in the form of ammonia. These are later converted into ammonium ions and amino acids.
Proteins are a chain of amino acids, so the amino acids present in the plants are converted into proteins. Therefore Nitrogen remains as the main ingredient in the formation of proteins.