I've seen first-hand that companies don't always do this.
Perhaps once a company files bankruptcy there's more oversight with this ... but before that happens, I've absolutely seen a company trying to cover its ass and limit its legal expenses by closing out unpaid invoices and stiffing their staff.
Norway has (had? I moved to the UK a decade ago) a great protection against this: Be late with payroll and any employee could have the company bankrupted without paying a fee. All it took was filing a form.
Now, of course, at the bankruptcy hearing the company might be able to pay money due to staff and avoid being put under administration and shut down, but it's a very effective way of ensuring companies keep on the good side of their staff when cash gets tight.
Taxes also pay for a fund that covers back payment of salary for up to 6 months in the case of a bankruptcy where staff have been more lenient, and so provides both a safety net and a reason for staff to be more accommodating if there's hope of improvement.
Perhaps once a company files bankruptcy there's more oversight with this ... but before that happens, I've absolutely seen a company trying to cover its ass and limit its legal expenses by closing out unpaid invoices and stiffing their staff.