What's not well known is that Google still operates in China and makes billions [0] off advertising there. So Google has hardly 'pulled out of China' despite not running a search engine. At this point, they wouldn't succeed even if they tried - so it's more an excuse than anything else that they don't _want_ to operate Google the search engine there.
[0] https://www.theinformation.com/articles/googles-ad-sales-fro...