It is no coincidence that the Taliban's seizure of Kunduz came at a time of unprecedented internal fragility for the group, writes Milo Comerford.

When Afghanistan completed its first democratic transfer of power in September 2014, after months of disputes over a power-sharing agreement between the two main political blocs, the shadow of totalitarian theocracy was far from the minds of most Afghans.

Yet just over a year on, the Taliban movement, under new management, once again commands headlines, and their reinvigorated insurgency continues to build momentum. Recent data from the UN indicates the movement has spread through more of Afghanistan than at any point since the Islamic Emirate of Afghanistan fell in 2001. Security officials rate the threat level in almost half of the country's administrative districts as either "high" or "extreme," levels not seen since the American-led invasion. In the first six months of 2015, the UN Assistance Mission in Afghanistan documented the highest level of civilian casualties in the country since it began keeping authoritative records in 2008.

This data was recorded before the Taliban's temporary takeover of Kunduz, Afghanistan's fifth-largest city, at the end of September 2015. The Taliban only held Kunduz for two days, but scenes reminiscent of ISIS' rout of Mosul's Iraqi garrison were crushing for morale, and as many as 100,000 residents fled. Numerically superior Afghan forces crumbled under a three-pronged Taliban offensive, and international special forces were integral to the city's recapture.

Hundreds of Taliban fighters were sprung from prison, and took with them heavy artillery, Humvees, and large amounts of ammunition belonging to Afghan security forces in the Taliban's 'tactical' retreat, under the auspices of sparing any further civilian bloodshed. In a characteristic emphasis of their supposed piety, the Taliban later singled out two Afghan television stations as "military objectives" after the channels reported allegations of rape by Taliban fighters during the fighting in Kunduz.

The rout of Kunduz resembled ISIS' takeover of Mosul.

Although a former Taliban stronghold, and one which had come under attack several times in 2015, the ethnically mixed Kunduz is far from the movement's southern and eastern Pashtun heartlands. James Stavridis of the Fletcher School of Law and Diplomacy compared the episode to Vietnam's Tet Offensive; an attack that did not prove a tactical success for the insurgents, but that had the potential to shock the new administration – and its American backers – to the core.

The Kunduz saga caused President Obama to reverse his plans for troop withdrawal, to assuage Afghan fears of an Iraq-style pull out. The President announced on 19 October that the almost 10,000-strong American force stationed in Afghanistan would remain until the end of his term in 2017, a reversal of plans to withdraw all but a small embassy-based force within the same time frame. There are fears this will play into the Taliban's rhetoric; one of the group's main prerequisites for peace talks is the unilateral withdrawal of foreign 'invaders.'

This bold display of the Taliban's continued relevance, arguably the movement's greatest military success since 2001, represents a significant reputational boost for the movement's new 'Commander of the Faithful' Mullah Akhtar Mansour. Until Kunduz, Mansour struggled to hold together an increasingly disparate Taliban following the news of the movement's founder two years earlier.

Still, Mansour faces significant challenges within Taliban ranks. It took months for Mullah Omar's son and brother, influential figures in the movement, to drop their opposition to Mansour's leadership and swear allegiance. On 20 October, Taliban commanders dissatisfied with their recently appointed leader supposedly held talks to choose a rival, the same faction that previously released a statement claiming "the [new] leadership that was established was unprincipled and disorganised." Taliban propaganda paints a narrative of Mullah Mansour as a legitimate spiritual successor to the movement's founder, with emphasis on his unique capacity to restore the Taliban's fortunes. It is unclear how much support the anti-Mansour faction has, it is thought to include prominent figures in the Taliban's shadow state, including provincial governors, former-ministers, and senior members of the movement's political office in Qatar.

Rifts in the Taliban may aid ISIS' divisive rhetoric.

There are fears divisions such as these over the movement's leadership could cause dissuade Mansour from engaging in a new round of peace negotiations with the Afghan government, even if such talks are sponsored by his close partner Pakistan. On a local level, there is concern that further breakdown in the unity of the movement could create a vacuum, which militants sympathetic to the aims of ISIS could exploit to expand their foothold across the country.

ISIS' 'Khorasan Province,' a splinter of disenfranchised Taliban fighters looking to associate with the current leading brand in global jihadism, is fast consolidating its presence in Afghanistan. A September 2015 report from the UN's al-Qaeda monitoring team found ISIS was recruiting in 25 of the country's 34 provinces, with a number of foreign fighters from Pakistan and Uzbekistan thought to have joined its ranks, and up to 70 fighters from Iraq and Syria.

ISIS has already garnered a reputation among local Afghans for its ultraviolent approach, and its ability to pay generous salaries of up to 500 dollars a month. A police officer from the Mahmand Valley, ISIS' latest stronghold in eastern Afghanistan, told Sudarsan Raghavan of the Washington Post, "there's a huge difference in the way the Taliban was treating the people and the way [ISIS] is now... I prefer the Taliban any day." The Taliban even condemned the "barbarity" of an ISIS' propaganda films showing the detonation of a group of "apostate" Afghan prisoners in the eastern province of Nangahar.

The great losers in this contest of extremes are ordinary Afghans, and a fledgling unity government attempting to build up state infrastructure required to control and administrate this geographically and culturally disparate country. Both the regime and the growing base of ISIS-support will likely continue their established course. The Taliban faces the greatest task of introspection in the coming months, as it formulates a more coherent vision of its role in Afghanistan's future.