Oli Scarff/Getty
Apple has a bigger cash pile than any other company in the world, but it doesn't stash the most money outside the US.

With $124 billion, Microsoft had the most profits among S&P 500 companies kept outside the US last year, according to fourth-quarter company filings compiled by UBS.

US companies hold more than $2 trillion in profits abroad for various reasons. The most controversial is to avoid paying taxes when they repatriate the funds, since the US statutory tax rate is the highest among developed countries.

President Donald Trump's short tax-reform plan unveiled last month included a "one-time tax on trillions of dollars held overseas." That cash could be put to work in the US economy through capital investments and job creation. But several analysts expect that much of it would be spent on share buybacks, dividends, paying down debt, and propping balance sheets.