Nervous investors have socked $3.4 trillion away in cash. But stocks are rising and their nerves are calming, leading bulls to view the huge cash pile as a sign that markets have room to go higher.

Assets in money-market funds have grown by $1 trillion over the last three years to their highest level in around a decade, according to Lipper data. A variety of factors are fueling the flows, from higher money-market rates to concerns over the health of the 10-year economic expansion and an aging bull market.

Yet...