When a metal atom reacts with an oxygen atom, a new compound is formed. A compound that is composed of a metal and oxygen is called a metal oxide.
For example, when magnesium metal reacts with oxygen, it produces the oxide compound magnesium oxide:
`2Mg + ~O_2 -gt 2MgO`
The Law of Conservation of Mass states that the total mass of the reactants is equal to the total mass of the products. Although oxygen is a gas and is invisible, it still has mass.
The mass of the oxide which is composed of both magnesium and oxygen is greater than the mass of the magnesium metal alone; however, if you add up the mass of the reactants (the magnesium metal and the oxygen gas), you will find that they have the same mass as the product (magnesium oxide).