Four lessons:
Binary representation of determines which powers of you multiply
Taking modulo after every step prevents overflow without changing the final result
Iterative version uses space instead of recursion depth
This same technique applies to matrix exponentiation and other algebraic structures
Modular exponentiation is a staple in competitive programming. You'll use it in number theory, combinatorics, and cryptography problems.