Many of the localities with pension shortfalls either borrowed against them (and never paid it back) or diverted contributions over the years for politically favorable projects. You can't trust politicians with a pot of money sitting in front of them that won't be paid until they are out of office.
The Feds are a great example of what basic pension mgmt can achieve when the rules are followed and no one dips into the kitty. They had generous pensions under the old system and a decent one under the new (FERS) system. The trust fund was never raided by Congress (unlike SS) and continues to exist today. In 1990, the balance available was $238B. After meeting all of their generous obligations and investing in little more than 10Y and 30Y Treasury bonds, the balance as of 2016 is a tad under $900B and projected to exceed $1T in 2020. That trillion dollars of cash invested in a (normalized) 10Y note at 3% generates $30B a year in interest alone - covering more than 30% of the annual obligations. That's the original premise and value of a pension fund, not some ledger entry holding the place where the money was borrowed with a fictitious projected rate of return going forward.
Of course the people in those municipalities that raided the kitties are long gone and all of that was forgotten - as they knew would happen. No one sits around today talking about how that councilman in Detroit made the call to short the contribution in March of '78. All we talk about is what it looks like today. Learning has not occurred.
One other note about firefighters making huge money. A number of municipalities have studied this and concluded that it is cheaper to pay one firefighter overtime than to hire additional firefighters. This results in some younger guys that work every possible hour making salaries that grab headlines and sending kids scurrying for applications. The primary element in the equation is the benefits package overlay. If an employee makes $80K a year, the cost to the county may be $125K once you factor HB matches, 401K matches, pension contributions, sick leave etc... If one guy works tons of hours they are paying one overlay vs. four or five overlays. Secondarily, his tax rate is higher and more of the excess funds are returned to the municipality. It also prevents overhiring and the need for layoffs if the additional hours are not needed in subsequent years (severence, unemployment payments, etc...)