The reason given for balancing chemical equations is the law of conservation of mass. They say that we balance equations with keeping in mind that atoms of every element included in the reaction must be equal on both sides of equations. And they just add some coefficients for this purpose.
But I apprehend why is the amount of substance not brought under consideration while doing this?
For example when we write,
$$\ce{H2 +O2->H2O}$$
That is; until we don't know how much of $\ce{H2}$ and $\ce{O2}$ was included in the reaction, how can start to balance it? How can we decide that atoms are not equal on both sides? However, the molecular formulas given above are only representing the substances.