Google did not have as much skin in the game as Apple does. If Apple defied the CCP, they could lose their factories overnight. To say this would cause immense damage is an understatement. They would have no product to sell within weeks and they would have no means to produce anything. It would be catastrophic.
Google, on the other hand, walked away from China and it's business as usual for them.