Only about a dozen companies, led by Apple Inc. and Alphabet Inc., hold more assets in their corporate treasuries.