50 years ago I was awarded a scholarship to pursue a Master’s Degree in Public Administration. Part of the program required an internship at a California County. I can remember numerous conversations back then about the relationship between salary and pension benefits. In general, public employees made less than private-sector employers, but they had higher job security and exceptionally generous pension plans. However, the guaranteed pension benefits were based on the lower salaries. See Detroit Gap Reveals Industry Dispute on Pension Math.
Then, thanks to Jerry Brown, the current California governor, public employees were allowed to unionize. With unions came political clout and the power to negotiate higher salaries for public employees. Gradually, public employee salaries rose to equal private-sector salaries and when you factored in the exceptionally high paying guaranteed pension plans and free medical care, public employees made more than their private sector counterparts.
How do you fix this problem? Public employees are a special interest group with enormous political clout. The solution is in the hands of politicians who are more interested in being re-elected than they are solving problems that are beginning to bankrupt an increasing number of cities, counties, states, and countries. This means the problem will not be solved. Short-term bandaids will be applied, but the major underlying problems will be largely ignored, just like Social Security and Medicare.