how do you lose almost 1billion and still have 4 billion is cash?
The short answer is "very good credit" and, in previous years, lots of collateral (valuable airplanes) to support billions of dollars of debt.
It's a fair question, and despite the fact that it's been asked and answered numerous times in this forum over the past decade, it deserves a couple more paragraphs.
The net losses are the difference between revenue and expenses. Over the past decade, they total well over $10 billion. How does AA have $4 billion in the bank?
Immediately after September 11, 2001, and continuing thru 2002, AA borrowed several billion dollars to support its huge losses due to high expenses and the crash in revenues. After the concessions were signed, AA borrowed more money (as creditors were willing to loan once AA cut its expenses). Between 2003 and 2010, AA sold various assets like its interests in Orbitz, Hotwire, ARINC, etc. and raised a couple billion dollars from that "furniture burning." As debts matured and had to be repaid, AA was able to refinance those debts (essentially, roll them over).
Think about it this way. Say you and your family begin living beyond your means - your annual expenses begin to exceed your income by 5% or 10% of your total income. Not to worry - you have excellent credit and the ability to borrow. Citi and Cap One and HSBC and others have provided you with credit cards with a total credit limit of, say, $100k or $150k. You begin using those cards to fund the shortfall in your income. Can you do that for one year? Probably. Do it for a decade, however, and eventually you won't be able to cover the min payments and you'll reach your credit limits, making further borrowing impossible. Unless you have a rich relative leave you a pile of dough or you win the lotto, eventually you'll be faced with bankruptcy. When you file, you might have a few thousand dollars - maybe even $10k in the bank, but if you owe ten times that much, you're bankrupt.
Every dime of cash that AA has in the bank is borrowed. That cash has nothing to do with the annual net losses.