My intro to and summary of the topic:
In year 2000 the Spanish government set up a surplus fund (the Fondo de Reserva) for retirees' pensions. It was designed to address future shortfalls between Social Security tax receipts and retirees pensions. Until 2010ish, the Social Security (SS) system ran an annual surplus: more tax revenues were coming in than pension payments were going out, so the piggy grew fatter and fatter.
By 2011 the crisis had been going on for quite a while. By then the SS system did not run an annual surplus anymore, and in fact it starting running deficits, because the unemployment rate is so high (which means less tax revenue for the SS), but the number of retirees goes relentlessly up. So the government has been tapping the surplus fund, every now and then, to pay the retirees' pensions.
How large is this piggy bank now? To give you an idea, if the SS had to pay retirees out of the Fondo de Reserva alone, without using any tax revenues, it would last eight months. At the pace the government has been tapping the fund over the last 12 months (about 10 billion euros), the fund would run out by the summer of 2019. In the short run, that pace may actually increase, as unemployment has kept rising, but in the medium term (beyond 2014), it is reasonable (I think) that the deficit of the system will start shrinking, and the fund may actually not be completely depleted. One thing seems certain: the piggy will be a lot thinner by the end of 2014 than it was in 2010.
To make matters worse, 97.5% of the fund is invested in Spanish sovereign debt, which has gone down in value since the early 2000s, as yields soared. The strategy of divesting from non-Spanish debt and investing into Spanish debt, back in 2011, may have lent some support to yields, but that balloon of oxygen for the sovereign is now exhausted, and all that is left is a Fondo de Reserva that is tremendously exposed to the credit risk and duration risk of Spanish sovereign debt.
The long-term solution, of course, is to get the Social Security system in order, by increasing the retirement age (faster than they are already doing it), finishing off the reform of the labor market, and steering the system away from a pay-as-you-go system to a capitalization system (I won't get into a discussion of whether that should be sponsored by employers or by the government--the important matter is to gradually downsize and eventually eliminate the pay-as-you-go scheme as the main source of pensions for Spanish retirees).