When the magnesium metal burns it reacts with oxygen found in the air to form Magnesium Oxide. A compound is a material in which atoms of different elements are bonded to one another. Oxygen and magnesium combine in a chemical reaction to form this compound. After it burns, it forms a white powder of the magnesium oxide. Magnesium gives up two electrons to oxygen atoms to form this powdery product. This is an exothermic reaction as well as combination reaction.
2Mg(s)+O2(g)→2MgO(s)+energy