It’s why Microsoft and Apple are available in China.
Here is a Google example from when I lived in China: Google was at the time competing with Baidu over the search image market in China. My home internet was fast and with great quality. Only Google image search results had very often problems loading image previews. Its not that it "didn't work". It just failed "a little", maybe half the images in the results pag didn't load. So Google image search wasn't really blocked. It could have been total coincidence that it was like that for years and only for Google image search. The site that was coincidentally competing over the lead in the Chinese search market against a Chinese company. After some weeks, I started using Baidu image search, even though their result quality was worse. But at least it worked. I am sure many people in China did. That's "competition" in China.
They just relinquish certain strong hold to a sovereign nation, like they have to host their data center inside China (both politically important, and economically beneficial). And they also risk their data being stolen (or so they claim).
Imagine, if a Chinese company wants to operate in US but refuse to comply local regulations, what will happen to that company?
Fb, Google and others are banned from China because they refuse to cooperate. What about Tiktok?