The Chinese government did not decide this on a whim, these companies are not willing to comply with Chinese rules within China. Whatever we might think of these rules the bottom line is that these companies are not in China because they have decided not to be. And when they try to move in, like Google did, their very employees argue against it.
China is Apple's largest market, iirc, they are doing very well there. For smartphones their market share is 3 times their market share in India. Still, a lot of Chinese still cannot afford iPhones and China has many domestic manufacturers: Actual competition is fierce, this has nothing to do with politics.
The argument that the US are retaliating against China blocking the FAANG is largely for the show but not reality.