Lucas Jackson / Reuters A worker walks underneath an American Airlines airplane at Miami International airport in Miami, Florida November 29, 2011. American Airlines and its parent company AMR Corp filed for bankruptcy on Tuesday after failing to win a labor deal with pilots and suffering from mounting fuel costs.

Having $4 billion in the bank is not your typical definition of broke. That’s why American Airlines’ parent company AMR surprised a bunch of people — particularly, one presumes, the five Wall Street analysts who still rated the company’s shares a “buy” — when it filed for bankruptcy on Tuesday. Its comfy nest egg aside, American isn’t facing any looming debt payments. The company said it didn’t need emergency financing, like most bankrupt firms do. It fact, it said that its cash on hand along with cash being generated by its operations was more than enough to continue to pay off vendors and business partners on time and in full. What’s more, American has no plans to call off its planned purchase of 460 planes over the next decade. Nor does it think it will have any problem getting the $13 billion it needs in financing to do so. Where was the cash crisis that put the company over the edge?

It doesn’t appear there was any.

(MORE: Why American Airlines Bankruptcy Won’t Affect Your Holiday Travel)

In fact, for a bankrupt company American Airlines was in reasonably good financial shape. And it may not be alone. Stockholders are typically wiped out in bankruptcies. But when mall operator General Growth Properties emerged from bankruptcy in 2010 it was not only able to pay off all of its lenders, but it had another $5.2 billion left over to give to shareholders. What’s going on? Bankrupt companies, it appears, are a lot healthier than they used to be. Here’s why:

Earlier this year, bankruptcy expert Lynn M. LoPucki and political scientist Joseph W. Doherty co-published a study analyzing the bankruptcies of 102 large companies that filed from 1998 to 2007. The professors were mostly looking at the fees the firms were charged by their bankruptcy advisers. But they collected all types of data, including the companies’ reported assets and liability at the time of their filing.

Here’s what I found when I looked at the data: The companies that filed for bankruptcy in the last five years of the study were in considerably better financial shape than the companies that filed for bankruptcy in 1998 to 2002. Typically, you think of a bankrupt company as one that owes more than it is worth. But that wasn’t the case for most of the companies LoPucki and Doherty looked at from 2003 to 2007. In fact, on average, the assets of the companies that filed for bankruptcy between 2003 and 2007 were 6% greater than their liabilities, meaning they were far from insolvent. That was a big change from the 1998 to 2002 period, when the companies that filed for bankruptcy were often truly in the hole. The companies during that period owed an average of 3% more than the total value of what they owned plus what was in their bank account. In that case, filing for bankruptcy is a no-brainer. The early 2000s recession could be altering the data a bit, but I don’t think that’s all we are seeing. In fact, my guess is that generally weaker companies file during good times. They are the boats that can’t even sail when the tide is rising.

(MORE: Going Shopping? Beware of Shopping Momentum)

So why are more companies filing for bankruptcy when it doesn’t appear they have to? In the case of American Airlines, the company said in a press release the main reason it was filing for bankruptcy was to “address our cost structure, including labor costs.” American and its unions had been negotiating for a while and had come to no agreement. Other airlines have used bankruptcy as a way to force its workers to take lower paychecks and benefits. American Airlines wants the ability to do that, too. And it’s not just the airline industry. Car parts manufacturer Delphi Corp. was accused of unfairly using the bankruptcy process to eliminate most of its U.S. workforce and ship those jobs overseas.

(MORE: How Much Are Workers to Blame for Inequality?)

So are all these bankruptcies in the economy’s best interest? There is no rule that says you have to be insolvent to file for bankruptcy. A company just has to show that it may in the future not be able to meet its obligations, and for American Airlines that appears to be true. The company lost money in 13 of its last 14 quarters – a total of nearly $5 billion over the past three and a half years. At the rate it was going, it clearly would have been out of cash. So American and companies like it need to be able to lower their wages when the economics of their businesses no longer work. But even if the unions weren’t willing to make a deal today, presumably they would have made a deal before the airline went under. Plenty of companies are able to reach agreements with their workers without filing for bankruptcy or having a strike. That’s why most of us a have 401(k) today and not a pension, and why our health coverage covers so little. So why couldn’t American? By filing for bankruptcy prematurely a company can gain the upper hand. Clearly, that’s what American Airlines is doing.

You could argue that bankruptcy is a costly process and that few companies would opt for it unless they had to. What’s more, a company’s biggest shareholders are often its own management, and they are not going to want to wipe themselves out. But when your stock is already down some 90% in the past five years, as AMR’s is, wiping out that last dollar or so of worth to dramatically lower your expenses might seem like a good deal. What’s more, management is likely to get a whole heap of new shares when the company emerges from bankruptcy. The UAW has argued in earlier cases that companies have abused the bankruptcy code when it comes to their negotiations with unions, and that Congress needs to do more to protect worker salaries and pensions in bankruptcy proceedings. I’m not 100% sure that’s the case here. But it sure seems that way.

Stephen Gandel is a senior writer at TIME. Find him on Twitter at @stephengandel. You can also continue the discussion on TIME‘s Facebook page and on Twitter at @TIME.