What happened in Egypt was very simple. The Egyptian government knew that a demonstration would be held by radical anti-American forces, including the local branch of al-Qaeda, outside the U.S. embassy. Through an understanding of the ideology, analysis of public statements and past experience, and probably intelligence penetration, it knew they intended to storm the embassy.

The highest levels of the Egyptian government decided not to protect the embassy, in breach of their international obligations. And they knew — or rightly expected — that the Obama administration would not punish them for behaving that way.

What’s the difference between Iran in 1978 and Egypt in 2012? In the first case, the Iranian Islamist government let its supporters take over the embassy completely and seized everyone inside as hostages. This led to a confrontation. The more cautious Egyptian regime simply let the mob trash the part of the embassy outside of the buildings. After all, there are billions of dollars in U.S. funds and arms to be obtained by a little restraint.

The Egypt case is also interesting from the Israel-as-canary-in-the-coal-mine image. A year ago, the Egyptian government let the mob attack the embassy and stopped them only when they were about to try to grab the diplomats inside. President Barack Obama finally bestirred himself and asked the Egyptian government to stop the assault.

I have heard some commentators bash Obama for making a gaffe in saying Egypt was no longer an ally. That’s not the point –Obama was admitting to the loss of America’s most important ally in the Arab world. It wasn’t a mistake. Obama, however unintentionally, spoke the truth. It’s the reality that’s so upsetting. (I bet that Obama is now being briefed on a long list of anti-American actions by Egypt’s government, including ones we don’t know about, and just blurted out what the intelligence and State Department people are telling him in private.)

A few months from now, it will be increasingly apparent that it is now in the enemy category.

Libya is more complex, and I’m going to try out a thesis here. I know I cannot prove it, but this scenario seems to make perfect sense in light of what we know. Forget about the probably made-up story by a left-wing, anti-American sensationalist British newspaper that the Obama administration knew about the attack in advance. They should have worried whether they had any specific data.

But that’s not what’s really shocking. Here’s what’s really shocking: there was so little American security presence on the ground. Why was the ambassador being taken out of his hiding place by Libyan forces that had no serious experience in counter-terrorist security and were badly infiltrated?

Here’s my theory: the Obama administration wanted to show that it was not some bullying First World government that looked down on the locals. Send in a platoon or two of crack U.S. forces? Why, that would insult the Libyans. Let them handle it themselves and that would show they were being treated as equals.

When the ambassador was killed, he was totally under the control and protection of Libyan security forces, accompanied only by two Marines. Doesn’t this strike anyone as strange? (The two Marines and the embassy public affairs officer were killed alongside him.) And after the ambassador was killed, a small force was sent in but operating only in partnership with a Libyan force (which seems to have been reasonably competent) to rescue the rest of the staff. But the Libyan commander himself noted that the terrorists apparently knew everything already about this hiding place, too.

An American security team should have been sent in to take out the ambassador and the others in a competent, professional manner rather than trusting Libyans who were: a) street guys a year ago who have had no training and experience, as well as b) deeply penetrated by the enemy force that simply could not be trusted. Remember that the on-site Libyan security forces simply ran away when the attack came.

Let’s be clear. Libya was the only Arabic-speaking country — maybe Iraq a few months ago — where the United States could have taken over protection without any political consequences. It is a real client state. And its security forces, being so new and so fully penetrated by the enemy, are probably the least competent. In contrast, when they let you get beaten up or overrun in Egypt, that’s on purpose.

So I wonder whether a serious investigation would discover that Obama and Secretary of State Hillary Clinton decided to show trust in Muslim allies — make them feel better about themselves, prove the United States wasn’t a bully but a real nice friend — and that led to the deaths of the Americans.

Remember Libya is a country where U.S. forces could operate freely if they wanted to do so, and easily settle any Libyan government complaints later.

Forgive me if I am wrong, but how else to explain what happened? If this view is correct, the deeply disastrous assumptions that have guided Obama Middle East policy have just resulted in the deaths of several U.S. diplomats and soldiers.