Today the Taliban controls more territory in Afghanistan than at any time since 2001.

Insurgents have threatened the major northern city of Kunduz twice since 2014, most recently a few weeks ago, and were only expelled with US support.

Meanwhile, many other provincial capitals are in danger, including Lashkar Gah in Helmand and Tarinkot in Urozgan.

How did we get here?

In 2013 Taliban insurgents and the Afghan military (and its foreign allies) were at a stalemate. The Taliban saw it as a "wait-and-see" phase.

"They knew that eventually, as President Obama had announced, all the foreign forces would leave Afghanistan, and then they would start a big push," Dawood Azami, the former BBC bureau chief in Kabul, told Rear Vision.

"This is what we saw. When the foreign forces left Afghanistan, thousands of militants and Taliban insurgents poured in."

Despite US and Afghan military efforts, the Taliban controls more territory than it did in 2014. ( Getty Images: Afghan Vice Presidency Press Office )

The situation was further exacerbated in June 2014 when the Pakistani military cracked down on Taliban militants in nearby North Waziristan.

Up to 5,000 militants crossed the border into Afghanistan to escape the Pakistani military, reinforcing the Taliban.

US President Barack Obama had planned to withdraw from Afghanistan completely by 2014, but according to Anatol Lieven, a professor of international politics at Georgetown University, he was forced to back down on his plan after repeated warnings that it would cause the Afghan army and state to collapse.

The NATO and US coalition had invested time and money training the Afghan military in preparation for the withdrawal, but much of the focus was on containing the Taliban in the south and east of the country.

After international troops left the insurgency spread to other parts of Afghanistan and the military was not equipped to respond.

Why is the Afghan military so weak?

The Afghan military is thought to be weak because of corruption and its reliance on the US. ( Getty Images: Noor Mohammad )

Professor Lieven argues that the Afghan armed forces are extremely corrupt and demoralised.

"They know that the US will in the end bail them out, with air power, and so they don't see the need really to pull themselves together," he said.

"I don't know any military expert who thinks that the Afghan National Army would last long in Helmand without the Americans behind them.

"I think the general sense is that without American backing the Taliban would make very extensive gains in the Pashtun areas and would eventually surround and starve out the major cities."

The problem(s) with Afghan democracy

In 2014 President Hamid Karzai's second term as president ended and elections were held. A record seven million people voted.

"It was the first time in the history of Afghanistan that power was peacefully transferred from one elected president to another elected president," said Dawood Azami.

"President Hamid Karzai was leading the country since the US led invasion of 2001, and he handed over power to President Ashraf Ghani in September 2014."

The election process, however, was controversial and arguably undemocratic. The vote split along ethnic lines and few thought the second-round runoff was credible.

Eventually the US had to broker an agreement whereby power was shared between Mr Ghani, a Pashtun, and his chief executive Abdullah Abdullah, who is of mixed Tajik and Pashtun ancestry.

Afghan president Ashraf Ghani, who was elected in 2014 amid allegations of fraud. ( Getty Images: Wakil Kohsar )

According to Professor Lieven, this arrangement paralysed the government and caused a large proportion of the population to become disillusioned.

"When I was there in the summer there was endless talk of mass movements against the government, that the whole arrangement is unconstitutional," he said.

Some resistance focused on Mr Ghani, who had worked for many years with the World Bank outside Afghanistan and is perceived by many to be out of touch with the problems of ordinary people.

"He worked for the World Bank promoting citizens' councils, citizens' charters in rural areas," said Jennifer Murtazashvili, author of Informal Order and the State in Afghanistan.

"When people don't have basic security, these [councils and charters] are not what citizens are demanding," she said.

"They are looking for basic protections from the state and they are not getting [it]. The insistence on these technical solutions really shows that he is out of touch."

The silver lining

Despite the problems of the past decade and a half, economic growth and relative stability have seen the lives of millions of Afghans transformed.

"There are many uncertainties … but at least in the cities, life is a sort of normal for women as well as men," Azami said.

"Girls and boys are now able to go to school, they have access to health facilities, there are roads, hospitals and universities."

On the rights of women there is also evidence of progress. Women now sit in parliament, there are women ministers and governors and there are women working in every ministry.

Why does the US remain committed to Afghanistan?

Currently the US pays for 100 per cent of Afghan security expenditure and between 80 and 90 per cent of the entire budget of the Afghan state.

According to Professor Lieven, the United States' continuing involvement in the country is a matter of pride and prestige.

"It's not as bad as Vietnam, but people all over the world will say the US military lost two wars," he said.

"Empires, if that's how you regard the US, depend heavily on prestige, on people respecting them. They would hate to lose that respect."

Spending to avoid a refugee crisis

A US withdrawal from Afghanistan might exacerbate Europe's refugee crisis. ( Getty Images: Shah Marai )

There also another issue: the flow of migrants to Europe, which is beginning to undermine European democracy.

After Syria, Afghanistan is the second largest source of refugees. If the existing state in Afghanistan collapses, the flow of migrants to Europe might increase dramatically.

"So $5 billion for the military, another $10 billion or so for the Afghan state per year, is perhaps a price worth paying," says Professor Lieven.

"As long as one has no illusions about what one is actually trying to achieve there, and also about being able to actually stop paying at any time in the foreseeable future."