President Biden says the failure lies with the Afghan army and government not having sufficient backbone. He insists they have the capability to fight the Taliban and are just choosing not to do it. Others are arguing that this outcome was inevitable, ever since Bush and Cheney decided to invade Afghanistan and quickly pivot away to fight Saddam Hussain in Iraq; Obama’s framing of the Afghan war as the “good war” was not enough to achieve U.S. aims, and Trump’s awful “deal” negotiated with the Taliban ceded almost everything the latter wanted in exchange for weak promises not to attack withdrawing American troops. Still others will argue that this outcome is the result of Afghanistan being a “tribal” and backward society in which Afghan soldiers have mysterious loyalties to kin and faith rather than to the nation-state.

None of these explanations is correct; they all adopt American perspectives and reveal an ignorance of Afghan experiences over the past generation.

It’s true that Afghans do not have a strong sense of national identity. To the extent that they have a national narrative, it is one that takes pride in their history as a country fought over by empires that has defied the attempts of those empires to control it. The British, Russian and American armies have all failed to hold Afghanistan.

But this lack of national identity is not because Afghans are not modern. It is because the fault lines in Afghanistan are not religious but ethnic. While Americans saw the problem with Afghanistan as a problem with a medieval Islam, the real source of tension for Afghans has been the mistrust between different ethnic groups.

The Americans decided early on that their nation-building project depended on the Pashtuns of the South. They were suspicious of the Tajiks, Uzbeks, and Hazaras, seeing them as too close to Iran. This was despite the fact that the Taliban were mostly Pashtuns allied with Pakistan, while the Northern Alliance that resisted them were made up of the Northern ethnic groups and allied with India as much as Iran.

America created a strange political system in Afghanistan: a democracy without political parties and a government without real power. Power lay with the ISAF forces and in Washington, and they tipped the last two presidential elections towards the Pashtun Ashraf Ghani, despite election irregularities and good evidence that the half Tajik Abdullah Abdullah won the last election.

In other words, the very people who historically opposed the Taliban were disenfranchised and marginalized by the U.S. and its Afghan allies.

My own research focuses on Afghan women and the gains they made in the years after the Taliban were routed. Millions of women have in the past 20 years accessed formal education, joined the labor force and participated in local and national governance. Yet, in negotiating with the Taliban, the U.S. made no provision for these women to have a voice or any guarantees of safety.

When I interviewed the leaders of NGOs in Kabul in 2010, they told me that if the U.S. withdrew they knew they would be killed. They did their work despite knowing this.

Can Afghanistan be a functioning state? Yes. To do so, it would require a regional agreement that involves Iran, Pakistan, India and multiple Afghan voices. The U.S. could have created a framework for all these parties to negotiate. The truth is that if the U.S. pressured India to make concessions on Kashmir, Pakistan may well have actually helped to eliminate the Taliban. Instead, Pakistan continued to let them recruit fighters, raise funds, buy weapons, and bide their time.

Now the Taliban are in a position of strength. And millions of Afghans who were hoping for a safer, more democratic future are terrified.

The crisis today is because of an over-reliance on the military to govern Afghanistan. Instead of investing in the people and scholars who actually know the region and the people, the international community decided to funnel resources through ISAF. Instead of a political process, we opted for wishful thinking that with enough weapons and training an army and a nation could be created.

We have to do better. Otherwise, not only will the Taliban control Kabul, their buddies will also take over Pakistan.

Nandini Deo, professor of political science at Lehigh University who studies the intersection of religion, feminism, and social movements in South Asia.

The views in this article are the writer’s own.