No, public pensions don't function like a ponzi scheme. There are actual pension funds that are actively invested and these profits do indeed help cover current and future pension payments. Yes, the government uses current pension payments to pay out receivers. But that's because it would be stupid to take out part of the pension fund, pay the people, and then put in the exact same amount from new payments. Instead you keep a balance sheet of how much was paid in and how much was paid out and the difference is added or deducted from the pension fund.
Yes, there are a few mismanged public pension funds. But they aren't nearly as common as people believe. And even in mismanaged pension funds the situation is still different from a ponzi scheme. Mismanaged pension funds use part of the deparment budget to cover the difference. This comes at the cost of cutting programs or downsizing in other ways. The more mismanaged the fund, the higher the percentage of the budget goes towards it. But that's another reason why they aren't lik a ponzi scheme, because there are different methods of funding them than just the payments of "new members joining".
Most mismanaged pension funds are from the private sector, not from the government. And there most aren't a ponzi scheme either and instead some other form of fraud or just plain old theft.
I still agree with an UBI being a better alternative.
Your assumption of what the graph displays is wrong. Yes, it lacks a lot of information and the post could have clarified more.
But at the bottom of the graph you can see that the x-axis is years. Which is a strong indication that this graph displays the life expectancy of latin american countries. Whicha quick goolge seems to confirm. And it shows that El Salvador ranks poorly even amongst them. Since most migrants move to a country for a better life, the pool of countries that El Salvador can pull from is rather small.
But that obviously misses the point that many people who would move to El Salvador on using this opportunity either move there to help improve the situation for the average person. Or at the very least would have enough money to afford a better lfiestyle and not be affected by the average life expectancy. Which obviously is going to be low for a country that suffers from poverty and gang violence as El Salvador does.
So the "general" assumption of migrants moving to a "better" countries doesn't quite apply here.