I hate to say it...but this is how working for a company works. It's more prevalent at the largest ones and less so at the smallest ones, but it's just the norm.

In the US, it's at-will employment. You can leave, or be fired, at any time - for virtually any reason. (As long as it doesn't break discrimination laws) Investors only care about quarterly returns, and so you have to expect a publicly-traded company may let people go for that reason alone.

They're not your friends. They're not your family. You exchange hours of your life for money. That's all. It sucks, but that's just how it is. Google is no exception, it is one company like literally all others.