The debate over TikTok has shifted very quickly. Just a few months ago, it seemed unlikely that the U.S. government would force ByteDance, the Chinese company that owns TikTok, to sell it. The platform is popular, and Congress rarely passes legislation aimed at a single company.

Yet a bipartisan TikTok bill — packaged with aid for Ukraine, Taiwan, Israel and Palestinians — is now on its way to becoming law. Late last night, the Senate passed the measure, 79 to 18, three days after the House passed it, 360 to 58. President Biden said he would sign it today. If ByteDance does not sell TikTok within 12 months, it will be banned in the United States.

What explains the turnabout?

I have asked that question of policymakers and their aides in recent weeks and heard a similar answer from many. Parts of the debate over TikTok — about the overall benefits and drawbacks of social media, for instance — are complicated, and they would not justify the forced sale of a single company, the policymakers say. But at least one problem with TikTok falls into a different category.

It has become a leading source of information in this country. About one-third of Americans under 30 regularly get their news from it. TikTok is also owned by a company based in the leading global rival of the United States. And that rival, especially under President Xi Jinping, treats private companies as extensions of the state. “This is a tool that is ultimately within the control of the Chinese government,” Christopher Wray, the director of the F.B.I., has told Congress.

When you think about the issue in these terms, you realize there may be no other situation in the world that resembles China’s control of TikTok. American law has long restricted foreign ownership of television or radio stations, even by companies based in friendly countries. “Limits on foreign ownership have been a part of federal communications policy for more than a century,” the legal scholar Zephyr Teachout explained in The Atlantic.

The same is true in other countries. India doesn’t allow Pakistan to own a leading Indian publication, and vice versa. China, for its part, bars access not only to American publications but also to Facebook, Instagram and other apps.