system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What has been happening in the Middle East for the past 20 years?

1. Why were we in Iraq and why did we back out?
2. Why are we still in Afghanistan, Pakistan, and Iran? If so, why?
3. What caused the instability of these countries?
4. What important decisions did President Bush and President Obama make regarding this region?
5. Is there a goal? What is the outlook of the members of armed forces?
gpt
The current situation in the middle east dates back to the first world war.

The Ottoman empire controlled most of the territory in the region. The Ottoman Empire fell at the end of the war and split into many smaller countries.

Since it was mainly the British and French who beat them they gained a huge influence in the region. The Anglo-Iranian oil company was set up in Iran. This company had a monopoly on oil in Iran, which at the time was a democracy. The company diverted all the money and almost all the oil to Britain and its allies.

Then the second world war happened. At the end of this the nation of Israel was set up. This angered the Middle East, nothing much came of it, but public opinion of Britain and the west was much lower.

In the 50's the democratically elected government in Iran decided that the Iranian people had had enough of the Anglo-Iranian oil company and decided that the war was long past and it was time they took their resources back. The British didn't want to go to war over this so handed the oil company back to the Iranian. The problem was that this was a major source of oil for the USA, who were much less happy with the agreement. The US sent the CIA into Iran to overthrow the democracy and put a pro-American dictator into power.

During the cold war Afghanistan and the Soviets were allies and attempted to get rid of the Afghan Mujahideen (the group that would later go on to become the Taliban). Since the US was so anti-soviet at this point they helped the Afghan Mujahideen by funding them and providing them with weapons. After the war against them was over the Afghan Mujahideen (now reformed as the Taliban) were so powerful, mainly due to all the support they got from the US, they went on to control most of Afghanistan.

Due to overwhelming dissatisfaction towards US in the region and the dissatisfaction with the pro-American dictator in Iran a man called Ruhollah Khomeini managed to overthrow the dictator and create the Islamic Republic of Iran, a hard right Islamic anti-American government for Iran.

Soon after the new government in Iran was formed Iraq invaded Iran. The US did not get too involved in this war though they did participate in some fighting and provide some aid to Iraq.

Israel has been a continuing western militaristic presence in the region.

Tl;Dr: -

* After the fall of the Ottoman Empire at the end of WW1 lots of smaller countries formed.

* Israel was formed after WW2 and there have been tensions between them and the rest of the Middle East ever since.

* After the Iranian democracy decided to disassemble the Anglo-Iranian oil company the USA decided to overthrow the government and put a dictator into power.

* While the Soviet's and Afghans were fighting the Afghan Mujahideen the USA supported them. The Afghan Mujahideen later reformed as the Taliban and with the money and weapons provided by the US they went on to control much of Afghanistan.

* The pro-American dictator in Iran was overthrown for a hard line Islamic government.

* The new Iranian government sparked a war with Iraq.