SURKHROD, Afghanistan — In one life, he was Zabet Khan, a 25-year-old with a high school diploma, four children and a fondness for taking photos with his pink selfie stick.

In the other, he was Commander Zarqawi, a Taliban veteran in eastern Afghanistan with 10 years of combat experience in a war he couldn’t break away from. Even after he went as far as Greece in search of a job, the war sucked him back in.

Mr. Khan’s life by the gun, and his death in a mysterious parcel bombing last August, point to how complex the Afghan insurgency has become as the United States tries to negotiate its way out of the long war.

Over 18 years, the Taliban’s ideological movement has intertwined with local rivalries, blood feuds and a thriving black market. And it may have seen a divide open up between some young fighters, like Mr. Khan, and the Taliban’s more dogmatic leadership.