Conservation of matter is the law. You can also call it the conservation of mass.
When we balance an equation, we determine the ratio of reactants to products which allows for the total number of atoms of reactants to match the number of atoms of the products. Since the type of atoms does not change (nuclear processes are a different story) and the number of atoms stays that same, the total mass that goes into the chemical change will match the mass that comes out after the change.
Here is an example:
2#H_2# + #O_2# -> 2#H_2O#
H-H + H-H + O=O -> H-O-H + H-O-H
There are 4H atoms before and after the reaction (each with a mass of 1 amu)
There are 2O atoms before and after the reaction (each with a mass of 16 amu)
The total mass before the reaction is 4x1 + 2x16 = 36amu
The total mass after the reaction is 4x1 + 2x16 = 36amu