The "surge" tactic didn't do anything in Iraq.
Deals were made with Moktada Al-Sadr who was a problem in the South and his militia men.
As those rebels aligned with the Iraqi government, the additional militias lost their support from these influential people.
That doesn't mean all the warfare has definitely ended. Perhaps it will flare up again.
But Afghanistan cannot be pacified with 20,000, or 30,000 troops. The Soviets had nearly twice as many as the current forces plus another 30,000 troops. People make far too much of "Stingers". The Afghans never won the Soviet war by destroying their planes, it was won on the ground through guerilla tactics. Of which they're very good at.
It needs a lot more, and quite frankly America is too broke to fund this pointless war for much longer.