That's the storytelling people keep repeating. That is not what is actually happening. Or at least, population is not getting older as fast as it's made to be and is not the biggest factor.
For instance, France have, successfully, bet on immigration. But the public discourse being what it is, since the population was getting older supposedly, we are now lacking in schools and universities because we chose to not build or/and renovate infrastructures. So now we have a real education problem for instance.
But the real problem with state pension fund in France is not that the population is getting older, the reality is that companies are simply not paying their due.
With all sort of tax credit and exemption, various French government chose to artificially lower salaries for all employees. Most of them are not even aware as this is not treated on the case by case but globally at company level.
The aim/excuse (depends on your political color) is to fight unemployment. The side effect, is that the state pension fund id depleting slowly but irremediably. On the other hand, to be fair, if you have massive unemployment, money is not entering the state pension fund either.
But the population getting older is a trick politician love to use to not have explain complicated issues and arbitrations made in depth. The lazy way out IMO.