The mathematics of spin glasses revealed a hidden structure that applies to many seemingly unrelated problems.