Social Security was ALWAYS a pay-as-you-go system. It was never the kind of retirement system you find in the private sector where people pay into an account, the money is invested, and then benefits paid out of the same account. It was a transfer scheme pretending to be a retirement plan. The beneficiaries have no contractual rights to anything and the system could be defunded tomorrow.
As a consequence of a number of factors, population growth being the most important, money coming into SS outstripped benefit payments for decades. The surplus was put into a slush fund. Decades back, government decided that the SS slush fund would be a good place to borrow money, so they did. all of it. Gone. Replaced with government IOU's.
Now, SS payments in are not covering payments out. That trend is expected to ramp up as baby boomers retire. The pretend surplus that isn't really there will cover the difference for a decade or so and then the thing goes belly up.
All ponzi schemes depend on an ever-expanding base of suckers to keep the thing going. SS was able to last much longer than non-government scams because it could force people at gunpoint into the system But you can't force people to have more babies to pay into the system, so the scam is unraveling anyway.