Google has the discomfort of finding that to operate in any country it has to abide by or compromise with its local laws. You would have to be in the boardroom of Google to know the exact truth of its relationship with China, but what is factual is the 2010 discovery that Google had been hacked by agents within China (mainly to smother human rights activists); there was a subsequent closure. Since the number of Chinese internet users is double the number of US residents, the loss was extreme, so Google diverted the Chinese arm to Hong Kong where there is no censorship. China censors firmly in a number of areas.
Google delivers a transparency document showing where and why some of its content cannot be shown and who has requested that. However, in August 2018 word got out that Google had developed a different search engine for China that would block out information that China wishes to firewall.