If a company files for bankruptcy, it must pay back its debts before its shareholders. That means bondholders are in a better position to get paid back than investors when a company is in trouble.