Obviously it varies by employment region, but my contract doesn't say "You work 40 hours a week". It says "We own everything you create while you're employed by us".
This is common but not universal. The agreement I have with google, by contrast, gives them a perpetual, irrevocable, nonexclusive right to use anything I create while I work here. This is not the same as owning those things.
One contract that was handed to me from an established company even included a clause that any IP created by even up to 5 (FIVE!) years AFTER you're no longer employed belongs to the company. Vaguely defined as anythikng related to the 'core business' (technology). Ridiculous and thankfully at least under CA laws completely unenforceable bully tactics.
California has laws explicitly prohibiting the latter. If you work on your own time with your own equipment, then the company doesn't own the IP. Technically, you're supposed inform your employer of the work, but I have no idea how that works in practice.