$$\begin{aligned}m^{ed} &\equiv m\bmod n\\ ed &\equiv 1 \bmod \phi(n)\\ \end{aligned}$$
Why does the modulus of the modular multiplicative inverse have to be the totient function? Won't any positive integer coprime with $e$ work? Can someone explain why the totient function is needed? How did the inventors of RSA arrive at the totient function?