In the nitrogen cycle, how is nitrogen fixed into the atmosphere?
Actually, the term "nitrogen fixation" denotes something very specific. It refers to the way in which nitrogen is taken from the atmosphere and transferred into the ground. You are talking about the opposite process (from ground to air). I will talk about both below.
Nitrogen fixation is the process of nitrogen going from the atmosphere to the ground. The atmosphere is 80% nitrogen gas (N2). Most of this nitrogen is gotten into the soil through nitrogen fixing bacteria. They use hydrogen to convert the nitrogen gas into ammonia (NH3) and ammonium salts. This ammonia is then used by plants and bacteria to make various molecules. Nitrogen fixation can also occur via lightning energy which converts N2 into nitrogen oxides which can then be absorbed into the ground.
The process of nitrogen going from the soil to the air is called dentrification. This process occurs mainly through anaerobic bacteria. These bacteria use oxidized nitrogen in place of oxygen as the electron acceptor to remake N2 gas. This gas is then released back into the atmosphere.