First a couple of definitions. Simplifying the academic definition of Nation building, my definition is a process by which all the people within the boundaries of a nation feel they are citizens of that nation; e.g., all the people of Iraq believe they are first of all Iraqis not Kurds , Shi’a, or Sunnis. This process can entail, propaganda, information, industrialization, , and military conscription, etc. For instance Egypt has long used military conscription as a nationalization process for peasant Egyptian youth who had little loyalty to anything or anyone outside their village. On the other hand State -Building entails basically building a viable infrastructure for a modern state; roads, power, water distribution, etc. It appears the United States has hoped to use state-building to create a type of nation-building, i.e., a nation in the political image 0f the United States, ostensibly a democratic nation of free individuals with protection of minority interests.
For the most part we failed in Iraq and now it appears our failure is even more obvious in Afghanistan. Our troops have departed and the Taliban take more territory every day. There are voices among the world elite cosmopolitans decrying the fate of the exceedingly thin layer of westernized Afghans who will be at the mercy of medieval barbarians who are poised to take over the rest of the country. We can sympathize with the fate of educated women, who will be relegated back to the conditions of the era of the Prophet and educated young Afghan men hoping for a better future, but there is little we can do for them. Twenty years we spent there. The Russians spent nine years there attempting to set up some type of Middle eastern version of a communist state. The Russian investment was much less in monetary terms so but they lost 15000 men as we lost over 23oo. As the happy Russian soldiers crossed back into Russia there were many snide articles about the Russians running from Afghanistan with their tails trailing behind them. I assume they are enjoying great deal of schadenfreude at this time.

I do not not have a number of lissome lady research assistants gathering stats for me so Im not sure how many billions we wasted on Iraq but in 2018 at a conference in Kuwait the Iraqis asked for another 88.2 $ billion. Of course few countries have officials stupid enough to offer anything near that. One estimate is that we have spent 100$ billion . Nearly all of it wasted. For those interested in details you can go to the web site of the Office of the Inspector General for Iraqi Reconstruction. (OIGIR). Waste and corruption was, and is, pervasive and endemic among the Iraqis and yes…among the tidal wave of American contractors as well. Has Iraq made some progress? Yes but for the money very little…some glittering shopping malls and new government buildings, but overall, as an Iraqi friend of mine observed on her visit to Baghdad, it is as dirty and corrupt as it always was. As one might guess the OIGIR recommended the usual remedy that bureaucrats love…. creating an overall agency to coordinate the reconstruction efforts of the DOD, DOS, and the USAID; i.e., Hundreds more bureaucrats pulling down good salaries pushing papers across desks, and DOD, DOS, and USAID officials fighting to maintain their piece of the money pie.

I am among the very few who still maintain we did the right and courageous thing to invade Afghanistan and destroy the Sunni Arab – led al Qaeda and its leadership. It was also the right thing to do to invade Iraq and destroy the tyrannical Ba’athi regime and their nuclear capabilities. And yes, had we not invaded, the Iraqis would have nuclear capabilities by now. If it makes one feel safer that both Iraq and Iran would have nuclear capabilities – as a number of pundits seem to suggest…well I can’t argue with that type of hazy convoluted thinking.
The mistake we made in both countries was one usually made by Westerners involving themselves in the Middle East….. we stayed too long.We were never welcome by the majority of the population in either country, even by those we were saving from slaughter. Of course the knives are out among pundits, experts, and ideologues excoriating their favorite targets, dissecting the reasons for our failures. They have plenty to work with. One group that has escaped much of the criticism- but definitely warrants it- has been our military leadership. One article, although it is a bit harsh… because we have some excellent flag officers –but unfortunately not at the top– pretty well exemplifies my thoughts about this. excerpt below. found at https://thefederalist.com/2021/08/06/americas-generals-lied-lost-wars-and-looted-the-people-they-pledged-to-serve/

“For too long, America’s generals have relied on a “stab in the back” thesis to justify their failure on the battlefield. The narrative set in after Vietnam and has calcified today. Former national security adviser and Lt. Gen. H.R. McMaster tweeted on July 8 in regards to the sweeping march of the Taliban that the “US media is finally reporting on the transformation of Afghanistan after their disinterest and defeatism helped set conditions for capitulation and a humanitarian catastrophe.”
McMaster’s attempt to deflect blame for military failure on an insufficiently obsequious media is unacceptable. He and his fellow generals knew full well that Afghanistan was unstable and that our strategy wasn’t working. Instead of speaking up, they lied to the public and then jumped into the private sector to reap the reward of misbegotten trust.”
It is particularly ironic that H.R. McMaster in his excellent book Dereliction of Duty scathingly criticized the Johnson Administration for repeatedly lying to the public and media during the Vietnam war. Lesson learned: If you continue to write be consistent or penitent if facts force an opinion change..
So what overall wisdom can be learned from the multitude of recommendations, suggestions, lessons learned ( a misnomer if ever there was one)?

As the bureaucrats and experts were flying to Iraq to join in the Bremer team to build the new Iraq, one journalist reported seeing them reading books on the reconstruction of Germany and and Japan after world war II. He doubted they would be of much help. He was correct. Japan and Germany are nations, cohesive, patriotic, unified.The Germans and Japanese did much of their own reconstruction. Yes we helped with the Marshall plan, in Europe and with about $182 b. for 16 nations and$ 2.2 b. for Japan. but essentially they cleaned their own messes up.
Iraq and Afghanistan are not nations. They are, as one writer termed it ,”Tribes with flags.” The fact that the old tribal system has largely faded away has in no way changed the culture of the Middle eastern society. Blood, kinship, and the concentric circles of clan and family still rule. The development of a civil society has not occurred. Just as Saddam diverted water and power from the Shi’a areas to his “people,” the Sunni Arabs of the north, the Persian ruling Shi’a of Iran divert water and power from the Arab areas to the Persian heartland. Nepotism, the infamous wasta still rules education and employment opportunities.
The Return of Islam,” as Bernard Lewis termed it, has rigidified the structure of society. The failure of western ideologies, particularly fascism and communism has caused a retreat to the comfortable and understandable…. the mysteries and solidity of Islamic faith. On the other hand true democracy has never been sincerely tried. The major pillars of a democratic society are largely counter-cultural to Islam and the vagaries of Middle Eastern culture. It is unlikely to find a Middle Eastern home in this century. There are many reasons. The fact is that few can read and even fewer understand the scriptures of the Qur’an, in its classical Arabic, or the multitude of Hadiths( sayings of the Prophet Mohammad) with its varying interpretations. This ignorance enables despots in clerical garb, to have an inordinate influence within the society.. “Westoxidation,” or the adoption or imitation of Western tenets of civilization are seen as great evil and a threat to the religious clerics who exert great power even beneath the facade of military rule.
Their belief in the triumphalism and superiority of their faith impedes their ability to fully assimilate into a Western civilization or accept its basic tenets. The anguish of Jehan Sadat went through after the assassination of Sadat reveals the extent of anti-Westernism and hatred for those Middle Easterners accused of associating themselves with it. Among her “crimes” according to a leading cleric was “refusing to stay in the sanctuary of her home, cleaning and cooking as the wives of the prophet did.” Finding a home in the West fleeing persecution and starvation of their home countries they tend to settle in ghettoes and insist on living by the same rules of their society from which they fled.The example of the Harkies (Algerians who sided with their French occupiers in the civil war) and fled to France to avoid massacre are now a major problem in France as they and their descendants have created little Algerias and challenge French secular rule.

While the ability of the Middle Eastern Islamist are quick and amazingly innovative in their ability to use Western gimmicks and technology, they are a people who have learned the dance steps but have yet to hear the music. Advantages of one segment of society are not to be shared but kept locked up for the benefit of those who possess it. Information is power.
So if (a big if) we must go into another Middle Eastern country…go in and kill those who need to be killed, destroy the war infrastructure, including their military or armed forces organization, provide some limited humanitarian aid and depart forthwith and without further delay.