The decision was made by by civilian leadership. That decision was made a year ago.
I use to work as a personal assistant to a CEO to a sizable company. He told me right up front that my job wasn't just to do what he asked but to anticipate what he needed to get done and do that.
The military leaders had two decades to plan an orderly exit. They were also ordered to withdraw a year ago. WTH have they been doing? How can anyone possibly argue that this wasn't a military failure?
I'm arguing that such statements as "they had 20 years to plan" and "the decision was made last year" aren't remotely definitive.
The top brass could have "anticipated" all they want, if they were given orders otherwise, that is the end of it.
As Zinni discussed in his book, they did wargames and strategic anticipation of an invasion (and occupation) of Iraq. They included cultural, economic, social, and religious factors. They already knew well in advance there would be a drive for regional Kurdish autonomy. They knew a sectarian feud would occur, they knew the western provinces would become a hotbed of insurgency.
They dutifully reported all of these things and presented plans to address these issues.
The Kurds pushed for autonomy. The sectarian strife did occur. The provinces did become a guerrilla war zone.
Does that mean "the military" blundered?
In contrast to some people's belief, the general staff is not comprised of cowboy jar-heads. A great deal of logical, methodical, and rational consideration can be found at the highest levels of operational command.
You'll much more likely find that "we'll march in with our overwhelming force and achieve victory with brute force" in the civilian side of things.
Biden is CnC. He could have reversed course (or changed the priorities of what objectives were to be reached). Naturally, one might raise the objection that Congress would then have to appropriate funds or the government in Kabul would have balked or any number of other
political considerations led him not to do so.
But we don't nearly have enough insight to declare outright where the fault lies.