The law is to force any company that isn’t US owned that the US doesn’t like to hand over ownership. Regardless of your thoughts on TikTok/ByteDance/China in general, this is not a law one should praise. It’s incredibly dangerous and is one more step toward the US becoming a full-fledged fascist state.
The law isn’t specifically for TikTok. Its to allow the US government the ability to ban any foreign owned company.