To a large extent, yes. Companies are required to pay for insurance on the pension, which is run by the federal government's Pension Benefit Guaranty Corporation [1], so it's not 100% dependent on the long-term health of the company. But the insurance doesn't necessarily cover the full pension, especially if it was a fairly generous one (there's an absolute cap of $60k/yr, and various other caps relating to years of work). In practice it does mean that how people fare in retirement depends in part on how lucky they were picking an company. If you're a retired electrical engineer who worked for IBM or AT&T, your pension is still fine. If you did the same job for U.S. Steel, less so.
[1] https://en.wikipedia.org/wiki/Pension_Benefit_Guaranty_Corpo...