Despite CalPERS, like most government pension plans, being vastly underfunded, they're actually still paying out more money to beneficiaries than they're taking in as contributions from municipal employees and employers.
CalPERS 2016-17 financial report:
Look at the numbers circled in green. That's what they're putting into investments. The numbers circled in red are what they're taking out each year.
The green numbers were even lower in recent years. CalPERS has been putting far less into the market than it's been taking out every year. They're belatedly starting to increase contributions, and the net contributions (green minus red) should turn positive fairly soon.
To the extent CalPERS is representative of public pensions overall (and it generally is), turning from net seller to net buyer will be a tailwind for stocks. And should stocks decline over a few years, it makes pensions even more underfunded and thus requires them to buy even more. Call it the CalPERS Put.