This is better explained by the Proust’s law or law of definite Proportion.
the law of unequivocal extents, some of the time called Proust's law or the law of positive organization, or law of consistent arrangement expresses that a given concoction compound dependably contains its part components in settled proportion (by mass) and does not rely on upon its source and technique for planning.