The corrupt elite in Afghanistan don't want to defeat the Taliban even supposing they could. They want to keep the war going to get US military funds which they can divert to their pockets.
In addition, they know it is hard for the US to cut down their opium or heroin exports while the war continues.
This makes the situation resemble that in South Vietnam, where the commanders did not want to win too much against the Viet Cong lest President Diem suspect they wanted his job. They just wanted to continue doing their jobs and bringing in the bribe money.