According to the law of conservation of mass, mass can neither be created nor be destroyed. Thus the mass of products has to be equal to the mass of reactants. The number of atoms of each element has to be same on reactant and product side. Thus chemical equations are balanced.
The balanced chemical equation will be:
Thus there are 2 atoms of oxygen in vinegar and 3 atoms of oxygen in baking soda. Which means there are 5 oxygen atoms on reactant side.