On Tuesday, a group of Islamic militants that were thrown out of al-Qaeda for being too violent took over Iraq's second largest city.

The Islamic State of Iraq and the Levant (abbreviated as ISIS) kicked the Iraqi Army out of Mosul, a wealthy city in northwestern Iraq. Today, ISIS secured another northern city, Tikrit. It currently controls an area "the size of Belgium," according to Jason Lyall, a Yale University political scientist who studies insurgencies.

Right now, the Iraqi government has no answer to the ISIS threat. And a hard look at the reasons behind ISIS' rise and the causes of its current success suggest a grim future for the Iraqi government's efforts to beat back the dangerous militant group.

ISIS grew out of the Iraq war's failure

ISIS used to be known as al-Qaeda in Iraq (AQI), the leading Islamist extremist group during the Iraq War. AQI controlled significant amounts of Iraqi territory during the war, until the US military and allied Sunni militias famously defeated it during the post-2006 "surge."

But they hadn't destroyed it.

Michael Knights, the Lafer Fellow at the Washington Institute for Near East Policy and an obsessive ISIS watcher, had been warning of the group's resurgence for quite some time. In 2012, he was asked to brief the US intelligence community on AQI's condition. "It was an NSA/CIA ambush," he recalled. "There were 30 intelligence analysts" insistently denying that AQI might be making a comeback.

The NSA/CIA folks were wrong and Knights was right. There are two reasons why, broadly speaking: the Iraqi government's incompetence and the Syrian civil war.

the Iraqi government's incompetence and the Syrian civil war explain ISIS rise

AQI had been "ripped down to the roots by US special forces" during the Iraq war, Knights says. In 2011, the group rebooted. They focused their identity around Sunni sectarianism, challenging the Shia majority and government's control over the Sunni population.

The government, according to Knights, "played right into their hands." Prime Minister Nouri al-Maliki "made all the ISIS propaganda real, accurate." They persecuted Sunnis and shut down the Sunni militias that had fought AQI during the war. That made it much, much easier for ISIS to recruit new Sunnis.

It doesn't stop there. The US and Iraqi governments released a huge number of al-Qaeda prisoners from jail, which Knights called "an unprecedented infusion of skilled, networked terrorist manpower — an infusion at a scale the world has never seen." US forces were running sophisticated raids "every single night of the year," and Knights believes their withdrawal gave ISIS a bit more breathing room.

The Syria connection

Then there's Syria. Look at this map, from March, of territory controlled by different factions in Syria. Notice all of that blue ISIS territory in eastern Syria, near the Iraqi border and Mosul:

The chaos in Syria allowed ISIS to hold this territory pretty securely. This isn't just a safe haven, though that matters a great deal. When I asked Knights where ISIS was getting the money and weapons to fund their campaign, he said, simply, "Syria."

"The war gave them a lot of access to heavy weaponry," he added. ISIS also "has a funding stream available to them because of local businesses and the oil and gas sector."

So the Iraqi government's missteps provided ISIS with trained operatives and a Sunni recruiting pool, while Syria gave them the opportunity to arm and fund themselves. That's how they grew strong enough to take Mosul.

How strong is ISIS, really?

Mosul is an extremely important city. It's Iraq's second most populous and sits near a lot of oil wealth. ISIS' ability to take it tells us that the group is even more powerful than most analysts believed beforehand.

"The ability to take Iraq's second city, and so quickly at that, speaks volumes about ISIS," Jason Lyall, the Yale insurgency expert, told me. "It suggests that the organization has a high degree of internal cohesion, strong command and control, and an ability (and willingness) to fight fixed, positional battles to oust Iraqi forces." In other words, that they can fight like a modern military.

I asked Lyall to compare ISIS to other insurgent groups he's studied. One of its core advantages, he said, is that it controls areas in both Syria and Iraq. When fighting Syrian troops, it can safely retreat to Iraq; when fighting Iraqis it can go to Syria. Statistical evidence says these safe "rear areas" help insurgents win: "one of the best predictors of insurgent success that we have to date is the presence of a rear area," Lyall said.

ISIS' big problem, according to Lyall, is their ideology. They were kicked out of al-Qaeda in February 2014 because they ignored repeated warning to stop killing civilians. Indeed, US State Department data says ISIS attacks are on-average some of the bloodiest of any terrorist group on Earth:

"Insurgencies can make do with passive support from the bulk of the population, but if an ideology is too radical, it risks sparking a backlash from among the population," Lyall says. "AQI [is] a good example of an insurgent organization overreaching because of its ideological principles," so ISIS may have overreach its DNA.

There's some evidence that ISIS is already alienating its support base. "Given the size of the outflow of people from Mosul, it is apparent that ISIS' ideology may find little support among the civilian populace," Lyall says.

But, in a way, that may be just what ISIS wants. Mosul "is a ghost town," Knights says, "and a ghost town is where ISIS dominates." If you destroy the police and other municipal institutions, it limits the government's ability to use police and civilian militias to challenge your dominance.

So can the government take Mosul back?

The next battle for Mosul — can America help?

"I think [Mosul] is too big for [ISIS] to hold," Knights says. Already, ISIS only really controls the western part of the city.

But there will be a huge struggle over taking the whole city back.

The Iraqi Army is not a great institution

The Iraqi Army is not a fearsome institution. Iraqi soldiers fled Mosul en masse when the ISIS takeover appeared imminent, leaving behind tanks, helicopters, and a fair number of weapons. "As recent efforts in Fallujah" — another city controlled by ISIS — "demonstrated, the Iraqi Army does not have the skill or the will to push back ISIS in house-to-house fighting," Lyall says.

Both Knights and Lyall think the next step is some kind of proxy militia battle, possibly on sectarian lines. Knights suggested local Mosul police and civilian militias, while Lyall bet on Iraq using Shia militias and Shia-only units of the army to dislodge ISIS. The Iraqi Army has an an airforce that it has used against ISIS in the past — with real cost to civilian life in tightly packed urban environments.

So there's likely a long, vicious, bloody battle in Mosul's future. And that's to say nothing of dislodging ISIS from its more securely held bases in both Syria and Iraq, the ones that Lyall suggests allow it to operate more effectively in both countries.

ISIS is not a problem with an easy solution. One might, though, expect calls for some kind of American involvement. After all, AQI, the group that eventually spawned ISIS, grew as a result of the post-invasion chaos. What else can it do?

Americans really don't want to go back in Iraq

One possibility Knights floated sounded a lot like a significant redeployment. "Nobody knows how to take ISIS apart like US Special Forces," he said. "If you had half a dozen US Special Forces teams working hand-in-hand with Iraqi special forces, with some fast-strike aircraft, some drones based at key Iraqi air force bases, and probably about 200 advisers sprinkled around Iraqi military units, they would make a lot of difference."

Even assuming that plan would work — which is highly debatable — it's not happening. Americans really don't want to go back in Iraq. "I think there is little that the US could do to change the situation short of actually doing some of the fighting (which no one is contemplating now)," Lyall said.

America's Iraq War is over. But the next Iraqi one may just be getting started.