This isn’t right, there is indeed a hierarchy. The liquidator gets their fees paid, then the fixed charge secured creditors get their security. Then there are preferential creditors which includes employees with unpaid wages or pension contributions. Then come floating charge secured creditors (with a calculation as to what portion of what they are owed they get based on sales proceeds - some may still pass to unsecured creditors even if the floating charge creditors don’t get 100%). Then come the unconnected unsecured creditors which includes HMRC and the likes of pinball distributors. Finally, connected creditors (like companies with common shareholders) and last of all, shareholders.Not anymore that was changed many years ago
Secured assets lenders get chance to get the assets back
Everyone else including hmrc get an equal share of any remaining assets / money after sale and liquidation costs
Of course, this is the UK, and the insolvency rules are a little bit different in Australia (though not by much).