Nitrogen was just part of the primordial gas and dust left in the nebulae that formed the solar system, the same as all the other elements. The difference is that Nitrogen forms a particularly stable diatomic molecule, so when you have a bunch of nitrogen in any form, it will tend toward reacting to maximize the amount of N2.
Then, once you have that, it floats above most of the rest of the Earth due to it being a gas.
Latest Answers