IANAL.
It's in pretty much every employment contract in the software industry. Washington has code 49.44.140 which makes such terms unenforceable unless:
>(a) the invention relates
> (i) directly to the business of the employer, or
> (ii) to the employer's actual or demonstrably anticipated research or development,
>or (b) the invention results from any work performed by the employee for the employer
California has section 2870, which is almost identical.
The problem is that those terms are vague enough that they can be construed to apply to pretty much any software. The big companies have varied enough business that (a) is hard to get away from, especially if it's Web based and you work for Amazon/Google/Facebook, and software techniques are generalizable that they could probably claim (b) as well. As a result, all of those companies have various internal processes to request that the company either release IP for side projects or allow it to be open sourced with the company as the copyright holder but the employee listed as the author.