It is mostly about taxation. Companies get taxed where the money is made/moved. A lot of the money in big company balance sheets is in Europe where they have lower corporate tax rates. If they moved that money back to the US, they would have to pay more tax on it. However, they have less need for the money outside the US, so the money just piles up.
Note, this is a very simplistic explanation of complex global accounting regulations (eg the money is likely "physically" in New York even though it is "legally" in Europe)