I was given the following practice question with the solution:
A practice question: find $\phi(27)$ and use it to calculate $300^{93} \pmod {27}$.
Solution: Since $\phi(27) = 18$, then: $$(300^{93\pmod {18}}\pmod{27})\pmod{27}=(3^{93\pmod{18}})\pmod{27}=3^3\pmod{27} =0.$$
My question is: Based on what theorem we mod the exponent $93\pmod{18}$ and why?