Factoring is hard; finding the period of a repeating sequence is the same problem in disguise. Shor's trick is to evaluate aˣ mod N for every x at once and let the quantum Fourier transform turn that hidden period into sharp peaks you can simply read off. This is the threat that RSA is racing — and the engine is the same interference you met in the algorithm theater, now buying an exponential speedup.