The Law of Conservation of Mass, also called the Law of Conservation of Matter, states that matter is neither created nor destroyed. The mass of matter in a closed system doesn't change over time even if matter is changed from one form to another. When a chemical reaction takes place atoms are rearranged to form one or more new substances with the total mass of the products always equal to the total mass of the reactants.
In the 1700s the French chemist Antoine Lavoisier showed that matter is conserved by carrying out chemical reactions in a system that didn't allow gaseous products to escape. Prior to that people thought mass changed during chemical reactions because gaseous products weren't accounted for. If you burn a log in a fire, it seems to mostly disappear and the small amount of ash that remains doesn't equal the original mass. However, most of what was produced is carbon dioxide gas and water vapor that escapes into the atmosphere. Lavoisier was able to show that these invisible products had mass and that the total mass of the products was the same as that of the reactants.