> From the outside it looks like if you work at Google, they take ownership of anything you write.
That is precisely how it works.
Disclaimer: I am not a lawyer, and I'm sure the validity and enforceability of the relevant contract clauses varies by jurisdiction.