In many U.S. states to include California, employment is legally considered “at-will.” This means the employer can terminate the employment agreement at any time and for nearly any reason.
You cannot fire someone for membership in a protected class (race, religion, sexual orientation, etc) or participation in protected activities like reporting an employer’s violations of the law, but it’s difficult to prove intent in such cases.
There are exceptions for unionized workplaces with collective bargaining agreements. Employers in those situations cannot fire employees without “just cause.” Google R&D is not unionized, however.