Google was never going to get what it wanted/needed in China, so walking away was a pragmatic stance projected as an act of courage, etc.
Google and Apple are actually more similar than one would thing. They are both leveraging their ownership of powerful segments, and they are both threatened by integrated software stacks. The big difference is that Google does creepy shit as a first party, and Apple outsources that to third parties.
Google’s ad business was hurt by Facebook/Instagram and the dearb of the web. Apple’s existential threat is someone making WeChat for the US.