A company can go broke before it has zero cash on hand. An example is United Airlines.
United reported in Q3 2002 that it had $1 Million in cash and $344 Million in restricted cash. In December 2003, it filed for bankruptcy.
When the cash available to pay bills gets too small, a company has to starts using cash to pay its important bills and lets its less important bills slide on the hope that things will get better. In the case of United, critical suppliers like jet fuel vendors were about to require cash on delivery terms for fuel. Once United declared bankruptcy, it in effect started over without debt payments and without paying its past due bills. It could then afford to pay for its fuel.
The fuel vendors were happy because there new fuel bills would get paid as part of the bankruptcy. The old bills would get a place in line along with the other creditors.
If United can get its act, together then it can reorganize and emerge from bankruptcy with a new start. If not, then United will be sold and the money distributed to creditors. United has been having trouble developing a viable business and there are reports that they may be liquidated.