the contract might not be literally enforceable by the courts, but the real threat of costly litigation can both intimidate employees and companies that might hire them.
If I'm 95% likely to win but it will cost me $100k and two years of stress to find out, then I'm going to have to care a lot.