They must obey the Law of Conservation of Mass that states that matter cannot be created or destroyed, it is conserved. Atoms are never lost or gained in chemical reactions, they are rearranged. The mass of the reactants must equal the mass of the products.