It was one of Trumps campaign promises to bring the troops home so he had to make some good of it before elections to try and keep some votes, but since he failed on some other things it cost him re-election. I'm no fan of Biden either, he should be home playing with the grandkids while he's still able.
As far as the Afghan War that should have been taken care of long ago. World Wars 1 & 2 combined never took 20 years and weaponry in those days was not as advanced at what one has today. They could have carpet bombed the whole Middle East in a year or less.