The Social Security surplus is used to fund general government operations and the Social Security Administration gets an IOU (Treasury security) in return. So it's still money the government didn't have before that it uses to fund its operations that it borrowed from a different self-funded program that had an excess, and it still needs to pay it back with interest. Usually the Treasury doesn't have enough tax dollars to pay it back, so they auction more bonds to the public and it gets added to the public debt at that point. However, if effective tax rates go up or spending is cut elsewhere then it can pay it back without adding to publicly held debt.
So you're right that it's not the same as publicly held debt. Rather intragovernmental debt is deferring the decision of how to pay for some governmental services to a later time, although usually it becomes publicly held debt. One way or another, the tax payer is on the hook for this spending which is part of the gross national debt, just like they're on the hook for publicly held debt.
So you're right that it's not the same as publicly held debt. Rather intragovernmental debt is deferring the decision of how to pay for some governmental services to a later time, although usually it becomes publicly held debt. One way or another, the tax payer is on the hook for this spending which is part of the gross national debt, just like they're on the hook for publicly held debt.