High cap companies use debt for this: bank loan is located in the market where it's needed most, and the debt is serviced by interest earned from securities in other markets. The net taxes are a small percent (think 3%) relative to simply transferring funds within the company. Yes, this is the low effective tax rate the EU is quite upset about.
Other reasons for not touching their holdings usually have a similar explanation. The securities are fungible for accounting purposes but not fungible enough for actual day-to-day operations. Result: securities get "stranded" and the large company grows a hedge fund appendage.