I don’t that “all of this could have been avoided” is a good take on this.
Afghanistan is a land of suicide bombers, terrorism and religious zealots. It’s a very dangerous place. We’ve lost over 2,400 service members there.
Getting people out sooner would have been best but we were always going to have a dangerous withdrawal.
Look at the US casualty numbers for the last three years, its very very low, there was zero need to make Afghanistan a worse warzone again. Taliban and ISIS will strike a deal and then what US is gonna do? There are zero options now.