In the study of number systems we learn the axioms of real numbers.
The commutative axiom $X.Y = Y.X$
The distributive axiom $X.Z + Y.Z = (X+Y).Z$
Well, the thing is that we are working with mathematical entities, we can add $X$ with $Y$ and form a number $Z$, we can add $X$ $y$ times and call it $X.Y$, which equals to $Y.X$.
Why do we assume these properties extend to objects that aren't mathematical entities?
For example: $2.apples + 4.apples = (2+4).apples = 6.apples$, we are using the distributive axiom here.
We can't add a number $X$ to $apple$ and call it a number $Z$, or add $X$ apple times and make a number $Z$, that proves they don't work like normal numbers, but we assume it behaves like mathematical entities to make equations and calculations. Why we can safely assume it works out all the time?