My understanding of it (and I'm sure it's a simplification, since I can only fathom simple problems) goes like this:
AIG was in trouble because it extended itself too far on insuring mortgage defaults. The banks were in trouble because they issued bad mortgages, most of which were insured by AIG which was not going to be able to make good on the insurance. The mortgages were bad because housing prices dropped.
Now, it seems to me the way to fix it would to be bail out one of the three. Fix the housing prices and the mortgages are good, sparing AIG from having to cover them.
Bail out the banks so they don't have to rely on the insurance money from AIG, sparing AIG from the effects of its shortfall.
Bail out AIG so they can make good in the insurance.
The government seems to have tried to all three...
Seriously, however, it is my understanding that the banks problem was that they used the CDS's as currency to cover their liquidity obligations, which is to say they didn't think they had to comply with the liquidity because AIG 'had their back' through the CDS's. AIG underestimated (way, way, underestimated) their potential liability incurred through the CDS's, such that they lacked the liquidity needed to cover the liquidity they were insuring. When the banks called in their markers, AIG was caught short.
As I said, bailing out AIG would appear redundant if you also bailed out the banks. However, I'll admit to being a bit (just a bit?) facetious. I am of the understanding that the 'bailout' amounted to merely backing the CDS's, such that they whether they 'bailed out' the bank or AIG was merely a relative position.
Quod scripsi, scripsi.