Here's why:
* Air is composed of nitrogen and oxygen. While oxygen readily reacts with magnesium to form magnesium oxide, nitrogen also reacts with magnesium at high temperatures, producing magnesium nitride.
The reaction can be represented as:
* 3Mg + N₂ → Mg₃N₂
It's important to note that the formation of magnesium nitride is a secondary reaction, and the amount produced is generally much less than the magnesium oxide.