When a business is in financial trouble, sometimes the best way out is to sell the business as some form of a going concern. Such a sale usually yields more than a piecemeal liquidation of the assets. Losses to creditors are minimized, as are losses to guarantors of debt.
Usually, rather than undertaking a distressed sale, it is better to turn a business around so that it is more profitable and will either sell more or generate cash to pay creditors. However, selling is necessary when that option is not viable, particularly in the eyes of secured lenders.