It is something called implicit parentheses.
This happens with division.
With $a+b/c-d$, this is left to right, and division has precedence over addition. Thus, $4+5/1-2=4+5-2=7$.
But with $\frac{a+b}{c+d}$, there is an implicit parentheses when division is expressed in this form. The functions in the numerator above the division bar and the denominator below the division bar are evaluated first and then the results are divided. This, $\frac{4+5}{1-2}=\frac{9}{-1}=-9$
Now, for exponentiation. There is an implicit parenthesis in the exponent. So, in $a+b^{c+d}$, $c+d$ is evaluated first, $b$ is raised to the power, and then it is added to $a$. $1+3^{2+1}=1+3^3=1+27=28$, while $1+3^2+1=1+9+1=11$
Now, for another example. $(4^3)^2=64^2=4096$, while $4^{3^2}=4^9=262144$