The NSA knew about "asymmetric cryptography" (what we'd call public-key cryptography) since the 1950's. They've always been far ahead of the outside world. It was the main draw of working there, which until very recently most (by numbers) cryptographers in America did.
Because cryptography is now mainstream. It protects our internet communications, and as a result there are cryptographers employed and supported at public institutions, paid with public grants or industry support, and no-longer-niche conferences and trade shows. This is without even considering the substantial boost to cryptography that the cryptocurrency boom provided.
Academics can serve on the boards of their students' companies as well as do contract work, all based on their public profile as academics. A mathematician working full time at the NSA cannot do that. The best they can do is leave and charge the government much more as a private contractor.