That's a bit of an oversimplification. They are enforceable under California law, but (AFAIK) only when equity is part of the employment contract. I'm not sure if stock options count; you'd need to ask an attorney.
Bottom line: if a company demands that you sign a noncompete agreement, that's your cue to ask for a chunk of the company.
In California, "every contract by which
anyone is restrained from engaging in a lawful profession, trade, or business of any kind is to that extent void", except for certain enumerated exceptions (Cal. Bus. & Prof. Code, Sec. 16600 [BPC 16600])
Those enumerated exceptions are, in summary form:
(1) Someone selling a business and/or its goodwill may agree not to compete with the business thus sold, if the new owner is carrying on the same kind of business (BPC 16601).
(2) Partners in a partnership may enter an agreement in anticipation of an eventual separation from the partnership, such as they would be able to do when selling their interest as described in 1, as may members of an LLC, mutatis mutandis. (BPC 16602, 16602.5)
Receiving equity in a business doesn't seem to qualify for any exception.
Are you saying that employees with a standard RSU grant are not eligible for protection of that law? I would guess most software developers in California are receiving some kind of RSU or option grant.
Broadly speaking they're unenforceable in the EU as well, anything beyond 3 months restriction in the UK would certainly fall under restraint of trade.
Employers include them in contracts to scare people, and generally it works.
Yeah, that's just for the chilling effect on people who don't realize it's unenforceable. A California noncompete is not something you'd want to take to court as a plaintiff.