Creative destruction is a woefully underappreciated force in capitalism. Shareholders can lose everything. Debt can be restructured or sold for pennies on the dollar. Debt can go unsold and unpaid, and the creditors can lose everything.
I think here it has to be mentioned that bankruptcy in the United States actually works very differently to bankruptcy in the European Union, where creditors have a lot more legal means at their disposal to haunt you if you try risky plays like taking on more debt to moonshot your way out of your current debt. In a funny way, a country's bankruptcy laws are their most important ones when it comes to wealth transfer.