The basic problem at PA was they paid way way too much for National, leaving themselves with a huge debt that the company wasn't big enough to pay for.
They had to sell assets to make up the difference between revenues and the money needed to pay the debt.
The domestic side was a nightmare loss maker, which was Pa's own fault for the way it integrated National. Infact the International side WAS PROFITABLE! However that was kind of false, they needed the domestic feed to fill the 747's to make the profit, and of course as just said the domestic side lost loads.
PA was very slow to make use of the smaller Airbuses on the Atlantic (which could have cancelled out the need for the loss making domestic feed), that was not entirely their fault because of ETOPS issues, ETOPS of course being new then.
The difference Lockerbie made was simple. It meant they couldn't by NW, although they were plain outbid by richer people there and it's not clear if a lack of Lockerbie would have made a difference. What the main effect was, is Lockerbie weakened the company. Therefore the major airlines (like UA and DL) were able to extract the best bits alone, without Lockerbie it's probable Pan Am would have gone like TWA/AA, as a whole the good the bad and the ugly. Lockerbie meant the majors didn't have to pay that price and could just have the good.
That explains why the company continued to dwindle slice by slice after Lockerbie (when there was no hope of it surviving, unlike the PAcific in 1985), until eventually nothing was left to sell.
PA was in trouble in the 1970's but overcame that, hence were profitable enough to buy new Tristars and of course get such outragious finance to buy National in the first place.
TWA is much more difficult to explain and I know much less about it.
As was said, traditionally TWA was loss making domestically and profitable internationally.
However, you need also remember TWA was never a strong business, which is why it built up Trans World Corp with Century 21 and alike (ie to compensate for that weakness). Wall St saw a very nice conglomerate, that is what would have been a very nice conglomerate had it not a weak airline attached onto the end of it. Result - the airline was dumped, by it's self (TW Corp which it established) if you like!!
As the profits had been put into building TransWorld Corp there was under investment in the airline, so it was alone and under invested - hence Carl Ichan could buy it and the results are well documented.
As well as Ichan, TWA scaled down their international network as the domestics started international flights and of course as terrorism, the high dolar, recession and the Gulf War put off international travel, especially to Europe.
As far as I can see, TWA in Europe was structured to handle the double daily jumbos (bringing 800 odd people) they used to fly in the early 1980's and not the once daily 762's or 757's (bringing less than 200 odd people) they had in the 1990's.
In Europe there are strong labout laws in many countries which prevented them from restructuring and left them with outragious costs in their formerly profitable division and the same old losses domestically.
Add to that Ichan and you can see they didn't have much of a chance. Karabu drained them of revenue, it would have been different without that, but how different is a matter of debate.
Flight 800, it seem quite remarkable how little the effect of that was. Yes the jumbos went soon after as did the Tristars, but that was happening anyway.
I personally believe their fleet strategy was too aggressive, I know an analyst that told me the cost of putting MD80's onto former DC9 routes while waiting for the 717's to come on line was greater than the saving made by retiring the DC9's. Plus as I (smug smug) argued at the time, the rentals were too high and meant little saving against the old planes (which you can see by checking old TWA Reports if you can find them), and short term greater costs because of retooling, all at a time when they were running short of cash.
In my view both were a chain of events and not an event.
Hope my ramblings are of some use