As battles go, it was a real shocker: less than 1,500 Islamic State fighters defeating perhaps 30,000 Iraqi police and troops. In the course of 6 days, from June 4th to June 10th, 2014, IS militia conquered Iraq’s second largest city using little more than suicide bombers and pick-up trucks. They should have been butchered: Iraq’s troops were well-equipped and theoretically well-trained by the Americans. Should have, yet weren’t; instead of victory, Iraq lost its biggest battle since the American invasion in 2003.

It taught us a lot about Iraq, about how states develop, and how quickly they can unravel.

Now Iraqi forces gather for the counterattack. From the ashes of the upcoming battle, we’ll learn even more.

First, lessons of the fall.

Despite lavish American spending on training and organizing the Iraqi state, Iraq’s forces were in no condition to combat the Islamic State. But why? Couldn’t the Iraqis have simply played the Stalin card and thrown bodies into the battle until they’d won?

That’s assuming a few big “ifs”. First, that would only work if Iraqi troops would carry out such an order; judging by the conduct of the battle, that was a major issue. Second, that order could only be given if commanders actually were able to give orders; we know that Iraqi troops got confused and contradictory orders throughout the fight. Third and finally, such a butcher’s bill could only be arrived at if Iraqi generals had the thought; it’s hard to know if those in charge of Mosul were even smart enough to consider such a strategy.

The central rule is this: money is not power. Money is useful for power, but it does not replace it.

In Iraq, there are dysfunctions that we in the West often presume are impossible. Westerns live in relatively corruption-free societies: yes, we moan about our police forces and Wall Street sycophant politicians, but that level of corruption is nowhere near what Iraq or states like it experience on a daily basis. Tony Blair may be a war criminal who might get off scot free, but that is entirely different from being an openly indicated war criminal definitely staying outside of prison.

Westerners presume that when orders are given, good or bad, they are overwhelmingly obeyed, especially by soldiers and cops. That’s the level of prestige we hold those professions: we generally believe that a soldier would readily bomb a village if told to, moral or not.

In Western societies, that’s quite true, and it’s both the cause and effect of their states’ efficiencies. It would be impossible throughout the West for a motivated handful of ethnic supremacists in pick up trucks to take over a city of one million people. Yet in a place like Iraq, precisely the opposite is true.

But why? Why won’t Iraqi soldiers and police behave like Western ones?

This tale begins at a human beginning: the nature of strangers in different societies.

The more strangers a place has, the more elaborate the systems must be to prevent their killing or stealing from one another. But these systems take time to develop: it can be generations, depending on how quickly people are being born and how often folks are moving to new places.

Modern societies are the most complicated: people move quickly and readily from place to place, while birth rates have brought some 7 billion of us milling about on this planet. By and large, it’s relatively easy to get people to carry out the cog-like actions of the world economy: they do something, they get something, in varying forms, worldwide. Getting people not to carry out economic behavior is actually the challenge: witness the Soviet Union, which tried to rid humanity of profit motivation, or North Korea, which has used inordinate amounts of power on on trying to convince North Koreans they need no other nation to survive.

But getting people to protect places they’re not from and people they don’t know is much more difficult. It’s easy to get someone to stack cement for you: offer them food, housing, or, society permitting, hard currency, and they’ll do it so long as they see your pay as sufficient. But ask them to die for a group of potentially ungrateful strangers? That is a far more complicated task.

Yet humanity has obviously achieved it to varying degrees.

The process: elites convincing selected parts of the nation to, on occasion, die for both.

Elites, remember, very rarely die in the course of conflict: in fact, the entire system is designed to maximize their protection.

As elites go about building these protections, they utilize all the tools they have.

First and foremost, they provide reliable pensions and paychecks: nothing motivates like raw cash. But such promises must have stability: security forces will readily abandon a state that has an inflation-wracked currency, or cannot keep its promises to pay out pensions in the distant future.

Second, elites must provide some sort of ideological, moral, religious, or ethnic backing to the task at hand: this is the propaganda that states rely upon if paychecks slip, or if soldiers do the rational calculation and realize just how little they’re getting paid, considering they might die in the course of their careers.

Third, elites must ensure they empower officers and commanders who do their job with the highest level of efficiency possible. Corrupt generals will absolutely cause defections or surrenders; bad officers will get shot by their own soldiers.

These seem relatively straightforward maxim to live by: pay your security forces properly, ensure they have something to believe in beyond the paycheck, and promote only good officers to lead.

Yet the devil is in the details. Many states manage all three relatively well; Iraq manages none.

To understand why, it’s because elites themselves must be unified on at least the broadest details of the purpose of the state.

Elites must agree on the identity of the nation, how the state protects the nation, and how the nation is governed. Iraqi elites fit none of these profiles.

Iraqi elites have more than a few competing views of Iraqi identity. Broadly, there’s the Sunni-Shi’a-Kurdish split, but even between these groups, there are subsets. Iraqi politics is an odd hodgepodge of coalitions and alliances: just because one is Shi’a does not mean one wants the state to run the same as the Sadrist down the road.

The ruling coalition, the State of Law Coalition, is made up of the Dawa Party, the Badr Organization, the National Reform Trend, the Islamic Virtue Party, and the Islamic Union of Iraqi Turkomen, amongst other, minor parties. While they are all Shi’a in identity, they vary on how they interpret Shi’a Islam and democracy; the Dawa Party holds that the Iraqi people are the vice-regents of God on Earth, and that while Shi’a jurists matter, they co-govern with the people. The Badr Organization, conversely, wants something more like Iran’s Islamic Republic; the Islamic Union of Iraqi Turkomen are an identity-based party that really just wants to keep Iraq’s remaining Turkmen safe.

Meanwhile, the government also has liberal business allies in the Iraq Alliance as well as Kurdish allies in the Kurdistan Democratic Party.

It’s all very confusing; that’s just the ruling government itself. Many parties exist solely because some elite dislikes another: the Al-Ahrar Bloc is essentially the same as the Sadrist movement without Moqtada al-Sadr, since Sadr is overbearing as a person.

As these parties squabble over how to govern, they also take advantage of the shattered nature of Iraqi politics to grab what spoils they can. This is very normal; all ruling parties try to dole out whatever goodies are possible, whether those are jobs or outright paychecks, to their supporters after winning elections. But in a broken political system like Iraq’s, such divvying is far more harmful: with that sort of fierce competition, it’s easier for small parties to get outsized bribes, diverting essential resources from the security forces.

Worse, parties try to grab control of segments of the security forces to protect themselves: no telling when a second Saddam might try to emerge. Failing that, they build militias: the Badr Organization is essentially an army that happens to also run a political party.

As a result, politics is increasingly propelled by narrow interests that seek the maximum bribe for the minimum work. This guarantees the bulk of Iraqi security forces are politically motivated appointees. Doubtless, talent exists within the pool, but so too do plenty of idiot cousins, given posts as rewards for support.

And these dysfunctions all played out in the battle.

When the Islamic State attacked, it did not have the same problems. While weaker and with access to fewer resources and people, IS had no identity problems: its elites knew precisely what they wanted to do, as did the fighters who worked for them. Officers were promoted based on loyalty to their ideology and efficiency on the battlefield; the requirements of war kept corruption to a minimum.

This made just about everything easier for the IS fighters attacking the city. The men in the trucks were motivated to the point of death; their commanders could trust their orders were followed. Their opponents, riddled with the same factionalism as the government in Baghdad, simply gave up. Even if Iraqi generals had ordered a human swarm, it’s quite probable nobody would have listened.

So how about that counteroffensive?

The last election was in April 2014, leaving the scattershot political landscape prior to the fall of Mosul intact. However, Mosul’s conquest and the consequent Islamic State blitz spooked Iraqi elites something fierce: this was no mere protest movement grabbing up neighborhood ethnic territory but a extra-national force seeking to displace, through murder and otherwise, the entire lot of Iraqi elite.

This forced discipline where there was none before: the collapse of Nuri al-Maliki’s regime was replaced with a comparatively more thoughtful prime minister, Haider al-Abadi, who has made a point of combating the corruption that has emasculated his security forces.

Key to this is outsourcing Iraq’s security to others. Individual Iraqi units do exist that are capable: in any mass of humanity, talent will find a way. Iraq has some 272,000 active soldiers, which should be more than enough to push the Islamic State back into Syria; the United States, after all, maintained its rocky occupation with far less. Yet since corruption has produced thousands of “ghost soldiers” in addition to feckless units, it’s far smarter for Prime Minister Abadi to seek security from outside forces.

The most powerful is the United States: with nearly 5,000 soldiers in country, any deployment of U.S. troops is a reliable one. These troops can be used to support the handful of reliable Iraqi units as they move northwards towards Mosul. But in addition, Iranian forces have also been deployed; they serve the same, less effective function as the United States. Russia is also dipping its toe into the field.

But because of tension between the U.S. and Iran, this is no great allied war effort to oust a common enemy, but a balancing act between regional foes hoping the other pays the greatest cost. That slows down the advance considerably: under the American occupation, the Islamic State would have never been able to hold Mosul for this long.

Now that the Islamic State has been pushed northwards, it seems probable that the same dysfunctions that hollowed out the Iraqi security services will return. When Mosul falls, doubtless Iraqi elites will see it as a signal to return to business as usual.

So how does one overcome such dysfunctions?

This is the key geopolitical lesson for all developing states. There must be some kind of pressure to improve: in Iraq’s case, it is a security crisis from outside the country. It can, also be economic, and the oil glut has also created a need to reform Iraq’s bloated civil service rolls. It must be clear to all elites that should the dysfunction not be addressed, their very lives will be at risk.

There is little outsiders can do to help beyond staving off state collapse, but too much help can cause the opposite of development, creating a culture of dependence that falls apart as soon as aid is cut. The current U.S. strategy of a few thousand soldiers is a smarter call in that regard: enough to help reconquer villages, but not enough to let Iraqi security services avoid the hard work of occupation and reintegration.

But most of all, time must pass. Moqtada al-Sadr, a strongly anti-U.S. Shi’a politician, once set his militia to fighting running battles against the United States; he believed quite firmly that Iraq would stabilize if the U.S. was ejected. He was murderously wrong; removing the U.S. nearly undid Iraq as forces once kept in check by Saddam’s iron fist and the American military came bursting outwards at the seams. Today, few Iraqis protest against the return of the Americans, let alone the Shi’a.

That could only come about through direct experience. It has now been 13 years since the U.S. invaded; the claims of pan-Arabists, Islamists, Iraqi nationalists, and others that the U.S. is the cause of all evil in the Middle East hold far less weight today than they did back then. We have seen the region is often just as much at fault; that forces change, whereas blaming faraway foreigners does not.

Once Mosul is secured, the war on corruption must continue. It may not; another cycle of near-state failure might be necessary to teach Iraqi elites what they must learn if they are to govern the whole of Iraq. That could be Kurdish secession, another major Sunni uprising, or a campaign of assassination against key Iraqi elites. Should Iraqi elites not learn the lessons of Mosul, another crisis will be waiting for them.