Most of them[1] know a whole lot more about constitutional law than the average lemming.
When things are working correctly, the Supreme Court's role is usually not very concerned with the facts of the case; its role is to resolve questions of law. Congress considered the facts including some classified briefings, decided that American app stores should be forbidden from distributing TikTok to American users, and made a law. The court was asked whether Congress has the authority to make laws like that, and the court decided that it does.
[1] Maybe not Clarence Thomas
I'm really surprised they're not pushing the web version, which can operate in a way not covered by this ban.