If a corporation has operations in a given country including a physical presence and employees and everything, then the profits connected to those operations are absolutely taxable there, regardless of where that entity is incorporated or where its securities are traded or anything like that.
From that perspective, the U.S. operations of a European firm look to the U.S. taxman very similar to the U.S. operations of a U.S. firm, and vice-versa.
The revenues of such operations are usually easy to work out, but the cost-side can be pretty difficult if it's globally distributed and double-taxation treaties are also pretty difficult. This is where transfer pricing and flag of convenience shenanigans come in, allowing these megacorporations to evade the taxman.
It's not like the political will to fix this stuff is not there, but it requires coordinated action from nation-state players, which is not that easy to accomplish.
So, instead, you get these populist governments pandering to their base by going certain things alone in a way that almost certainly backfires economically.
There are always local subsidiaries, so these are generally European companies making the profit and paying no tax. Several of these companies famously exploit jurisdictional loop holes with how they define where the value arises to avoid paying much tax anywhere. While there are rules around how they can do this, they do seem to be broken.
Then maybe the US should change that. Does not change the fact that other countries should be taxing US companies for their local online sales and revenue.
You get that european companies selling in the US doesnt pay american corporate taxes right?