Consider the formation of water molecule. Hydrogen combines with oxygen to form a water molecule.
In this case, the total mass of the reactants = total mass of the products. Also, the number of atoms of hydrogen and oxygen in the reactants side and the products side are equal.