How Western interests indirectly created ISIS, starting with WWI to present. This is my opinion. Feel free to correct me in the comments.
TL;DR – The British started it, the Cold War made it worse, and the Americans finished what the British started. And it was always about oil.
- After WWI, British interests installed client regimes and prevented Iraqi nation-building.
- This meant a number of ethnic groups were thrown together without any reason to live under one country.
- The only way to rule such a country is through forceful suppression of opposition — hence a succession of dictators who suppressed the many ethnic groups through force.
- By the 2003 overthrow of Ba’ath rule, Iraq was a powder keg waiting to explode.
- Ineffectual nation-building by the US ended what the British began and allowed armed groups, such as ISIS, to flourish.
1920 Treaty of Sevres: British Mandate of Mesopotamia created. 
1921: British create client state “Kingdom of Iraq” to control Iraq. 
1925: Iraq Petroleum Company (IPC) controlled by the British et al monopolizes oil production in Iraq till 1961. 
1920-30: Boundaries of Iraq established through conflict with Turkey, Saudis as the British try to hold onto as much territory as possible.  British intention to control Iraq means no nation-building occurs and Iraq is setup for failure .
1940-58: WWII and Cold War conflicts continue to destabilize Iraq.   The lack of nation building and continued external interference means the only way to govern Iraq is bloody suppression of the population.
1958: Iraqis opposed to Western interference overthrow the British client state. More instability. Nasserite influence perhaps encourages dictatorial rule and discourages creating civil institutions setting the stage for further instability.
1961: Qasim ends IPC monopoly in a time of Arab nationalism. 
1963: Ba’ath party takes power in coup. A succession of dictators rule Iraq.
1970s: Iraq has period of stability and does well. However, Shias are suppressed and become disaffected. 
1972: Iraq nationalizes IPC operations. 
1979: Saddam gains power.
1980-88: Saddam’s Iran-Iraq war is disastrous for Iraq.  Iraq supported by international community during war. Note that Iran is Shia-majority while the Ba’ath party excluded Shias. Thus, war exacerbates Sunni-Shia tension in Iraq.
1990-91: Saddam invades Kuwait. Gulf War ends in defeat for Iraq and destruction of infrastructure. Instability encourages separatism by suppressed ethnic groups, which are further suppressed by Saddam using force. Many die or are displaced. 
1991-2003: Sanctions on Iraq cause extraordinary hardship and further weaken the country. Saddam has no choice but to continue strongman dictatorship tactics to hold onto power.
In my opinion, at this point Iraq is a powder keg waiting to explode. Decades of external interference by Britain etc, sectarian tensions, lack of nation building, inheritance of arbitrary colonial boundaries, Cold War stresses, constant dictatorship mean a divided and traumatized country.
2003: Ba’ath government overthrown. Iraqi civil institutions are disbanded. The powder keg explodes in insurgencies around the country. The forerunner of ISIS is one such Sunni group, the Jama’at al-Tawhid wal-Jihad. 
2003-12: US tries to impose democracy on a country that lacks any history of democracy. Obviously, this attempt is a complete failure. Ethnic/sectarian tensions rise to the forefront, forming their own groupings. Shias come to power.
2006: ISIS is created. ISIS and other Sunni armed groups are a natural reaction to the Shia return to power. They follow from the causes described in italics above. 
2011: The Syrian civil war and the power vacuum near the Iraqi border give ISIS a path to power.
2012 onwards: Continued instability, power vacuum, an ineffectual Iraqi army, oil revenues, Sunni-Shia schism mean a place for ISIS, or really any group with good leadership and motivated, armed members.
Post-Script: I’m not historian. This is armchair history pulled from Internet reading. Please correct me if you are better informed than I am.