Afghanistan is a tough nut to crack. They fight each other all the time. They are in some of the most defensible terrain there is. And they are fiercely independent. All of that leads to a country that's hard to beat if we don't go in 100% to win. 100% leads to collateral damage, which is a no go.
So, people may ask why this is so tough. Why such a small country with few military resources is so tough. Let me relate a story a village elder told me when I was over there over a decade ago. My team and I were there with a group of representatives from the Afghan government and they were asking what they could do to help the village. He told them and then they asked if they could count on his support. He smiled, waved his arm around the village, and then pointed at himself. He said, "The blood in my veins has been Afghan for 60 years, it's been Muslim for 600 years, it's been Pushtun for 6,000 years."
So yeah, he would let the Government help his village. It would be foolish not to let them. He'd let us SF guys help his village too. But he wouldn't turn his back on his Pushtun tribe, many of whom were the bad guys we were fighting. That said, his was a friendly village and he sided with us more than against us. It goes to show that Afghanistan isn't so much a country as it is a collection of tribes that happen to live within a fictitious border that the Great Powers drew up 150 years ago. The only way to beat people like that is to break their will to resist… or just leave and let them have at it like for the last 6,000 years.