I would really like it if CEP had a thread explaining the basic history of the middle east snd how things have come to this with ISIS and the relations between the middle Eastern Countries.
I will ignore most Middle Eastern history and the relations between most states and try to give a very basic but concise run down of some of the major geopolitical factors which I think have led to the current mess.
Saudi Arabia and Iran are engaged in a contest for regional hegemony in the Middle East. Saudi Arabia is a Sunni state, Iran is a Shi'a state. Iraq has a Shi'a majority population, though under Saddam Hussein was ran by a Sunni elite, after Saddam was ousted Shiites have taken control of the government there. Although Syria is majority Sunni, it is ran by an Alawite (Shi'a) elite. Southern Lebanon has a large population of Shi'a Muslims, and is largely under the control of Hezbollah, a Shi'a group which is sponsored by Iran. Iran borders Iraq, Iraq borders Syria, and Syria borders Lebanon. Iraq also shares a large border with Saudi Arabia. The last thing that Saudi Arabia wants is for Iran to be able to consolidate a considerable sphere of influence right on Saudi Arabia's doorstep. If you look at a map of the Middle East you will see what I am talking about.
As you can imagine, after being ruled by an oppressive Sunni elite under Saddam there is quite a bit of tension between the Shi'a and Sunni communities in Iraq, and there have been numerous allegations of Sunni's being mistreated by the new government. Add to this all the weapons and the various militias that exist in the country following the US invasion and subsequent insurgency, and you can see how this is a recipe for trouble.
ISIS is a Wahhabist Sunni terrorist group, which is the same branch of Islam followed by the Saudi royal family. Saudi Arabia (and probably other Gulf states) funded Wahhabi Sunni militias which emerged during the Iraqi insurgency to reestablish Sunni dominance in Iraq in order to prevent Iran from expanding its sphere of influence, this has led to the formation of ISIS.
The Syrian civil war has arisen out of the Arab spring and the Assad regimes violent suppression of anti-regime protests, subsequently various militias with different geopolitical goals have formed in opposition to the Assad regime. After ISIS gained a foothold in Iraq it exploited the destabilisation caused by the civil war in Syria and expanded into Syria.
This is a very oversimplified account, I have glossed over a lot of stuff, and probably made a mistake or two. But, this is a basic state centered 'realist' analysis of how things have gotten to where they are now with ISIS in the Middle East. If you doubt my Saudi/Sunni vs Iran/Shi'a narrative you can also see this playing out in the Yemeni civil war, where Saudi Arabia is directly fighting the Iranian backed Houthi rebels which have taken control of the country. Another example is the recent Saudi Arabian intervention in Bahrain where they have propped up the Sunni royal family against a Shi'a uprising.