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.
At the time of walking away they had 33% of the Chinese search market - so it is hard to see how they did not have skin in the game - to lose all access to the largest market in the world forever. And not only for search, but also youtube, android and so many other things.
Android is open source so of course the lowest tier phone OEMs are going to fork/use it. I was in Shanghai a while and could buy counterfeit iphones too despite Apple being there.
Although I think they have regretted that decision.