The coefficients of a balanced chemical equation means number of particles (molecules or unit formulas) not mass.
The law of definite proportion states that a compound is constituted by the same elements in the same proportion regardless the total amount.
A chemical formula states the ratio of the atoms in a compound as number of atoms, not as mass or weight.
For example, the formula Na₂O means that the compound is formed in a ratio of 2 atoms of Na to 1 atom of O. (Not two grams of Na to one gram of O).
Then, the chemical equation Na + O₂ → Na₂O when balanced results in
4Na + O₂ → 2Na₂O.
The coefficients are used to balance the number of atoms in the compounds of each side: 4 atoms of Na in the reactant side and 4 atoms of Na in the product side, 2 atoms of O in the reactant side and 2 atoms of O in the reactant side.
So, the coefficients mean number of unit formulas, not mass.