Why do tax havens exist then?
The reason Apple, etc., invest a lot of their cash overseas is not because those are better investments, but because the US corporate taxes are so much higher those foreign investments become more attractive.
Level the taxes, and the money will be reinvested back in the US.
To know what they are investing in, consult the Apple Annual Report, which says. Even if the balance sheet says "cash", what they mean is "bank deposits". Bank deposits get loaned out to others, and those others spend it.
Nobody borrows money in order to hoard a pile of currency.