No, it is the default of the law. They don't need an employment agreement. See the links in my replies in this thread. The laws says the own nothing...EXCEPT...anything related to their business.
They are being generous (or maybe just trying to make sure people don't quit) by signing agreements that let you out of the default law.
From what I understand on this kind of stuff, it's completely determined by what contracts an employee has signed. "We own everything you do on company property or with company equipment" is basically universal and things done at your job are understood to be works-for-hire, but a company can't just claim "We own everything you do in your free time if it's related to computers" unless the employee has agreed to that in a contact. Am I wrong here?
For your Google example, I would assume their review framework was set up by an agreement with the employees. I had an offer for a job where I was told "Anything you do on your own time is yours. And if you want to put that in a written agreement for a particular project, we're happy to." From what you say, maybe Google doesn't have quite as lax an approach, but their ability to decide what you can and can't work on must have been specified in an employment contract.