One April afternoon in 2018, Zhang Yiming, the founder of the Beijing-based online media company ByteDance, got a notice from Chinese regulators to shut down an app where people shared jokes and silly videos.

He followed orders and expressed his deep remorse in a public apology. “I feel regretful because I have let down the guidance and expectations of the supervisory authorities all along,” he wrote.

Mr. Zhang pledged nine remedial measures. On top of the list: Build up the Communist Party’s presence at ByteDance and educate its employees to think from the perspectives of the party and the government.

Now ByteDance, which owns TikTok, is facing a similar order from the U.S. government: It needs to divest the short video app or it will face a ban. It’s fighting back in the U.S. courts.

It used to be that a Chinese company with business abroad could act subservient to Beijing in exchange for survival and at the same time enjoy the protection of private ownership and the rule of law in the United States.

But the ground beneath Chinese companies like ByteDance is cracking as the distrust between the world’s two superpowers deepens. The businesses are caught between their own authoritarian government and an increasingly suspicious, even hostile U.S. government.