Yes but it's not automatic. Creditors don't have any feelings of loyalty towards debtors the way employees feel towards employers. Creditors also tend to be businesses who are used to suing for their debts, unlike employees. So while employees should get paid first, you have to actually make a claim to that money somehow. I'd ask a real lawyer for the details.
It's really important to understand this. If you, as an employee, are not getting paid, then it's a pretty safe bet that no one is getting paid. You are just now finding out what the creditors have been dealing with for months. Missing payroll is deadly fucking serious. Get out now.
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.