I wanted to know what exactly is the difference between these two expressions and why they return different results.
$$5^{2^4} \qquad\qquad\left(5^2\right)^4$$
The left one returns $152587890625$, while the right one gives $390625$.
I know the right one is called "powers of powers", but I don't know about the one on the left and how it works.
$$5^{2^4}=5^{(2^4)}=5^{16}$$
But
$$(5^2)^4=5^{(2\cdot 4)}=5^8$$
We have $$5^{16}=(5^8)^2$$