The issue is that they're not paying taxes a first time.
Take Apple.
You buy a computer from them.
You don't just actually buy it from Apple in your country.
You buy it from Apple in Ireland.
Why?
Because Irish tax rules say income earned overseas is not subject to tax.
It goes like this:
Apple China has Foxxconn manufacture your iGadget for $100.
Apple China sells it to Apple Ireland for $105.
Apple Ireland sells it to Apple in your country for $1000.
Apple in your country sells it to you for $1100.
80% of the profit stays with Apple Ireland. No tax.
First off, that's a transfer pricing issue not really related to taxation of foreign profits in the US, as it's more about avoiding tax in foreign countries. And technically, if you "solve" this issue, that should mean that less tax on foreign profits should be paid in the US.
But also, it's a bit more complicated than you think, and I think Apple is a bad example. Allow me to explain, if you're willing to indulge in extended discussion of tax issues.
The supply chain is probably more simple--take away Apple China--it's likely that Apple Ireland buys directly from Foxconn. The price Apple Ireland pays Foxconn will more or less determine the Chinese taxation on the manufacture of the iGadget. But Foxconn is a third party, competing with Flextronics and Pegatron, etc. to get the iGadget contract, so you can't really say that the price paid to Foxconn or Foxconn's profit is unfair.
Let's just assume your country is Germany to make it easier to discuss. Apple Ireland sells the iGadget to Apple Germany, but it also sells the iGadget to Amazon Germany, T-Mobile Germany and other carriers, and other German Apple resellers for around the same price that it sells to Apple Germany. They all are happy with a 10% profit margin, and many companies compete to try to get qualified as Apple resellers and get a low-risk 10% profit on their sales of iGadgets. Can you say that the price charged to Apple Germany, if it is the same price that third parties are willing to pay for it, is unfair or unethical? If you forced Apple Ireland to sell the iGadget at a lower price to Apple Germany, you might run into anti-competition laws--at the very least, you are making the arrangement "unfair" in the third parties' eyes. And if you forced Apple Germany to pay a lot more tax then the third party resellers do on the same sale of an iGadget, Apple may think they should just conduct their German sales through third party resellers, which will hurt investment and employment (Apple does choose to not put up retail stores and sell only through third party resellers in some places).
It's likely that Apple Germany already books slightly more profit than T-Mobile or Amazon Germany on the same sale of iGadget, to be on the safe side.
A better example of transfer pricing issues are with software companies like Microsoft and Google, because they deal much less with third parties and thus have less of a defense for the prices they charge between their legal entities.
This transfer pricing issue is being targeted with the BEPS project, but like I said, something like Apple's situation would continue to exist because they have plenty of third parties in the value chain to use as a defense for claims of unfair pricing.
Do a Google search on IMF CDIS. These are the Direct investment statistics for all countries in the OECD and IMF who report on International Investment.
Find out who the biggest investors are in your country...
If it's not USA, UK, Japan or China (the biggest sources of investment funds) then it's dodgy. It's probably on the G20 list of tax havens and conduits.
Netherlands, Jersey. Cayman Islands. Luxembourg. Switzerland (CHF). Bermuda.
These countries are all relatively small and in no way rich yet they punch so far above their weight in investments in big countries. Why?
Because of shelf companies avoiding tax. They have no physical presence in these havens. They don't have any operations there. They just funnel their profits through there.
Yes it's legal. But it's unethical and it's a major reason why so many western nations are so far in debt. Companies not pulling their weight in the tax burden.
This is an entirely unrelated issue to the transfer pricing issue above. Most countries, including UK and Japan, don't tax foreign profits, but it still may make sense to channel investments through a third country that may have more favorable treaties.
For instance, if the Japan-Germany tax treaty says dividends from Germany to Japan will be taxed at 10% in Germany, but the Switzerland-Germany tax treaty says that dividends from Germany to Switzerland will be taxed at 5% in Germany, it makes financial sense for the Japanese company to invest in Germany through a Swiss intermediate company.
The trend to target these planning activities is to require presence in those countries (which is why companies more and more invest through UK, Hong Kong, Singapore or Ireland, where they have setup operations), and also just make tax treaties more favorable in general--so now many of the UK, Hong Kong, Singapore and Ireland treaties have treaty benefits that are on par with the so-called "tax havens" of the world.