Given a function \(f\colon X\longrightarrow X\), we define
$$f^0 = \mathrm{id_X}$$
$$f^{n+1} = f\circ f^n=f^n\circ f,\qquad n\geqslant 0$$
This gives us \(f^{n+m}=f^n\circ f^m\) and
\(\left(f^m\right)^n=f^{mn}\), which motivates the notation.
For example, \(\sin^3=\sin\circ\sin\circ\sin\), so
\(\sin^3(x)=\sin(\sin(\sin x))\).
The operator is well-defined due to the power associativity of function
composition.