How does Shor's algorithm break RSA and ECC?
It turns the hard problems they rely on into easy ones. RSA is safe because nobody can split a very large number into its two prime factors in reasonable time; elliptic-curve cryptography is safe because nobody can work out the secret number behind a public point on the curve. Peter Shor showed in 1994 that a quantum computer can find a hidden repeating pattern, a period, inside both problems, and from that period the secret follows quickly. On a large enough machine the attack takes a practical amount of time instead of an impossible one. Bigger keys do not save RSA or ECC: they only make the quantum attack somewhat slower. That is why the answer is new mathematics, such as the lattice problems behind ML-KEM and ML-DSA, for which no efficient quantum algorithm is known. Published estimates of the machine needed are still far beyond anything built so far.