I know that $2^{100} \equiv 1 \pmod {125}$ because $\phi(125)=100$. $125=5^3$ is also the perfect power of an odd prime, so it has at least one primitive root. So, it is reasonable to check if $2$ is a primitive root mod $125$.
To check this, it would suffice to find every divisor of $100$ as a power of $2$, but that would take a longer time than I believe to be necessary, because I read once that we only need to check the divisors $2^2\cdot 5$ and $2\cdot 5^2$ as powers of $2$. Indeed, neither of them are the orders of $2$ mod $125$, and I am also told that $2$ is a primitive root mod $125$. However, I don't quite understand why we only need to check $2^2\cdot 5$ and $2\cdot 5^2$.
On top of that question, how can we then generalize this way of checking to other mods?