The difficulty is in defining what "trading in another country" actually means.
If you sell a physical product, there are some unambiguous facts that can be considered: where was the product made, where did its components come from, where was it delivered, that kind of thing.
If you're selling information, say an e-book or an MP3 download, things are slightly more ambiguous.
If you're providing services of some kind, things get much more complicated, as anyone who has to deal with VAT in Europe can testify. There is a concept of the "place of supply", and trying to come up with a standard way of determining that place of supply that is both practical and reasonably fair to all concerned is still a work in progress.
And that is just for sales taxes/VAT, where the parties involved tend to be obvious (someone paid money, and someone received it). With multinational business structures, where you might have revenues and expenses in many jurisdictions and somehow you have to decide how to balance everything up and declare profits, there's an entire extra layer of ambiguity to contend with.
I worked for a Canadian company that sold niche hardware primarily into the US market. We were based entirely in Canada and just shipped to the US using UPS.
We regularly had to convince US business buyers that they didn't need a W-9 from us, nor did they need to withhold taxes.
Are we back to talking about sales or other revenue-based tax here? The major dispute we were originally talking about in this HN discussion was to do with where profits are declared and corporation tax or the equivalent is paid; I only mentioned the sales/VAT angle as an example of how easily tax rules can get complicated when you have to decide where some intangible thing happened.