The fiasco in Afghanistan should, by itself, bring a reckoning for the professionals who assured us it was a worthy effort. It won’t.

We witnessed the sudden, embarrassing end to a misbegotten nation-building effort costing more than 2,300 American dead and some $2.3 trillion in expenditures for warfighting, civil works projects, the now non-existent Afghan national army—not to mention veterans’ health costs.

The two biggest national security challenges of the post-Cold War era—China and the response to 9/11—have been gravely mishandled by America’s defense and foreign policy elite. America and its allies are now in a position of extreme vulnerability because of their gross incompetence. A period of maximum danger will last for five years or more, similar to America’s deteriorating international position after the fall of Saigon in 1975. The Chinese Communist Party leadership under General Secretary Xi Jinping cannot help but view American capabilities as weak and its leadership as craven. Taiwan, and by extension, Japan, are in China’s crosshairs with a major war on the horizon.

This danger will only begin to ebb when the U.S. successfully reverses a Chinese gain, shattering its aura of inevitability—something akin to the invasion of Grenada in 1983, which marked the first reversal of a Soviet bloc acquisition during the Cold War.

How did we get to our present state? Where were the main policy forks that might have seen a more honest and less incestuous national security establishment take a different path?

For our purposes, the beginning was with Nixon’s opening to China in 1972, as he sought to wind down U.S. involvement in the Vietnam War while deepening and formalizing the Sino-Soviet rift which started in 1956. It’s important to note that at the time, Henry Kissinger, the National Security Advisor, observed that the Chinese were “…just as dangerous (as the Soviets). In fact, they’re more dangerous over a historical period.” Kissinger went on to note that “…in 20 years your successor… will wind up leaning towards the Russians against the Chinese… (so as) to play this balance-of-power game totally unemotionally.”

In this, Kissinger’s warning about the Chinese parallels French War minister Philippe Pétain’s 1934 testimony before the French Senate about the Ardennes, “the Ardennes forests are impassable,” if adequately defended. Variations of this idea were widely shared among France’s defense establishment, but when the Wehrmacht came in 1940, only the first part was acted upon—the firm belief that the Ardennes was impassible. Similarly, Kissinger is remembered for the opening to China, but not his warning about 20 years on.

By the early 1980s, as the Soviet Union reached its apex in the correlation of its forces with the West, some two-thirds of Soviet Red Army divisions were assigned to the frontier with China. The purchasing power parity (PPP) gross domestic product (GDP) of the People’s Republic of China (PRC) in 1980 was $303 billion compared to the U.S. at $2,857 billion. Thus, the relative U.S. economic power was more than nine times China’s.

China’s communist party leadership ordered the crushing of the Tiananmen Square democracy movement in June 1989. Only five months later, the Berlin Wall fell. The Soviet Union would limp along for another two years, dissolving on December 26, 1991. The end of history appeared at hand. The PRC’s PPP GDP in 1990 was $1,111 billion compared to the U.S. at $5,963 billion with the relative American economic advantage being just over five times that of the PRC.

It was in 1990 that the recently retired paramount leader of the PRC, Deng Xiaoping, counseled his successors to “Hide your strength, bide your time,” when dealing with the West. They followed this advice for some 20 years.

During his campaign for president in 1992, then-Arkansas Gov. Bill Clinton was sharply critical of President George H.W. Bush for being soft on China in the wake of the Tiananmen Square massacre. A mountain of strategic campaign donations from Chinese interests and a Chamber of Commerce eager to make money in China were all the urging Clinton needed to see things differently. As a result, there was no reevaluation of the American relationship with China in the early 1990s as Kissinger predicted 20 years earlier.

It was during the Clinton Administration, in the heady days of the American hegemony in the post-Cold War world, that the process of accelerating technology transfer to China began in earnest. In 2000, at the urging of Silicon Valley, the Clinton Administration relaxed regulations to allow the PRC’s People’s Liberation Army to purchase high-speed U.S. computers capable of simulating nuclear explosions—without an export license or security review.

But in many ways, the process of strengthening the PRC had already begun a few years earlier when Western corporations, under the thrall of the emergent Chinese market, began to transfer technology to China as a Chinese precondition for access to their markets—the capitalists selling the PRC the rope with which they will hang them.

One illustrative example of this was the rise and fall of Lucent, a spin-off from AT&T, and the subsequent rise of China’s Huawei. Lucent Technologies was formed in 1995. By 1999, Lucent was the world’s largest telecommunications equipment firm, with more than 150,000 employees. In 1997, Carly Fiorina, later a candidate for the Republican nomination for president in 2016, was selected to lead Lucent’s global service-provider business, its largest customer segment. Within a year, Lucent consummated six joint ventures in China, transferring technology as the cost of doing business. A year after that, Hewlett-Packard named Fiorina CEO. By 2004, China’s Huawei started taking Lucent’s market share. By 2006, Lucent was gone—merged with France’s Alcatel.

Thus, in one short example, the American system’s weakness when confronted with the PRC’s remorselessly mercantilist system can be seen: short term profits for a business grown with U.S. R&D support and nurtured in an environment favorable to intellectual property rights, big payoffs in the form of stock options and bonuses to the executives who orchestrated it, followed by the utter collapse and hollowing out of American manufacturing capacity. Elon Musk is relearning this costly lesson with his Tesla China operations today.

In 2000, the U.S. Congress normalized trade with the PRC by approving permanent normal trade relations (PNTR). With an 11-seat majority in the House and a 55 to 45 majority in the Senate, it was mostly Republicans votes who approved PNTR under the last full year of the Clinton Administration. Only 15 senators voted against the measure, including eight Republicans, such as Senators Jesse Helms (NC) and Bob Smith (NH)—America-Firsters who presaged Donald Trump’s arrival on the scene 16 years later. The vote in the House was much closer, 237-197, with 57 Republicans and 138 Democrats voting “no.” A year later, China joined the World Trade Organization. In 2000, the PRC’s PPP GDP had more than tripled in a decade to $3,661 billion with the U.S. economic output less than doubling to $10,252 billion. America’s economy was now a little less than three times that of China’s.

With the election of George W. Bush in 2000, it looked as though America’s Cold War marriage of convenience with the PRC would be reevaluated. This took on greater urgency after an American surveillance aircraft was rammed in mid-air by a PRC jet fighter on April 1, 2001. The damaged aircraft was subsequently forced down on the PRC’s Hainan Island. The 24 aircrew were released after 10 days while the PRC’s military stripped and disassembled the aircraft, sending it back in pieces three months later.

But soon, al-Qaeda’s 9/11 attack would completely occupy the Bush administration’s attention. Any thought of reordering the Sino-American relations was abandoned and would remain so until the 2016 election of Donald Trump.

By 2010, the PRC’s PPP GDP would hit $12,291 with the U.S. at $14,992. China had almost caught up to the U.S. in economic output (yet with more than four times the population, China remained a relatively poor nation on a per capita basis).

Al-Qaeda’s successful 2001 terror attack required a U.S. response. The Bush administration issued a demarche to the Afghan Taliban that it deliver al-Qaeda leader Osama bin Laden and expel the terror group. It refused. The U.S. and the United Kingdom then launched Operation Enduring Freedom on Oct. 7, 2001. About 10 weeks later, the Taliban was driven from power and back into the hills and mountains of Afghanistan.

Initially, the U.S. response took the form of a punitive expedition to kill or capture those responsible for 9/11, hitting them in their bases in Afghanistan. Unfortunately, in what should have been the decisive battle at Al-Qaeda’s mountain redoubt at Tora Bora in eastern Afghanistan, some seven miles from Pakistan’s tribal territories, al-Qaeda elements exfiltrated through allied lines by negotiating a truce with a local Afghan militia commander. Thus, al-Qaeda remained intact, but was denied its freedom of operation in Afghanistan.

It was at this juncture that the project of trying to transform Afghanistan from a pre-modern tribal society into a modern democracy took hold. The fear was that without a stable and friendly central government in Kabul, al-Qaeda would easily return to begin plotting deadly terror attacks as soon as the U.S. withdrew.

Yet after the Taliban’s rout, would they, or any other nation or warlord, have risked their own lives to provide safe haven to al-Qaeda? A nation that allows itself to be used as a platform to attack America confers no obligation on America to leave that nation in better shape than it was before the punitive expedition to destroy the threat it hosted. American mission planners should be under no obligation to occupy and then economically and politically develop terror-hosting nations. This frees resources for more punitive expeditions—a virtuous circle—as well as more dollars for R&D and procurement to deter or defeat China.

Texas Congressman Dan Crenshaw makes much the same point in his Aug. 17 Wall Street Journal piece, drawing the distinction between nation building and maintaining the ability to kill our enemies as they emerge to present a threat to Americans. Crenshaw argues convincingly that Americans “…became exhausted over the years with the vast sums of money spent and lives lost, seemingly in a futile attempt to build democracy,” with “…a lot of foreign policy options between nation building and giving up.”

By September 2002, President Bush, elected with an open skepticism of nation building, addressed the UN saying, “the people of Iraq can shake off their captivity. They can one day join a democratic Afghanistan and a democratic Palestine, inspiring reform throughout the Middle East.”

In March of 2003, fearful of Saddam Hussein’s Iraq using weapons of mass destruction to carry out terror attacks—or lending such weapons to terror groups—the U.S. invaded Iraq and began the process of remaking that land and people as well—though in comparison to Afghanistan, Iraq was at least 100 years further along the process of becoming a modern state.

Here it’s useful to return to 2000 and the second presidential debate between Vice President Al Gore and Texas Gov. George W. Bush.

Bush cited the Somalian intervention as an example of nation building gone wrong, saying, “It started off as a humanitarian mission then changed into a nation-building mission and that’s where the mission went wrong. The mission was changed. And as a result, our nation paid a price, and so I don’t think our troops ought to be used for what’s called nation building. I think our troops ought to be used to fight and win war…”

Gore, on the other hand, harkened back to America’s occupation and rebuilding of Europe and Japan in the post-WWII, early Cold War period to broadly support the concept of nation building. That the preponderance of America’s foreign, defense, and intelligence establishment agreed with Gore, failing to see the vast distinction between rebuilding a modern nation with a highly educated population and Rule of Law versus the far more daunting task of birthing a modern nation from scratch out of tribal societies owing no allegiance to a distant central government.

Gore’s views represented the views of the national security clerisy. Views beyond the pale were excluded from consideration. Even before 9/11, Bush’s opposition to nation building would have never had a chance among the permanent officials who would have been tasked with implementation. It’s not in the foreign policy blob’s cultural DNA.

Thus, from the fall of the Taliban in late 2001 to its triumphant and chaotic return almost 20 years later, we temporized in Afghanistan. But while we borrowed and spent $2.3 trillion, the Chinese prepared, modernizing their military, vastly enlarging their nuclear weapons arsenal, and extending their reach, both in the South China Sea and abroad, with extensive predatory infrastructure projects in strategic locations.

By 2020, China’s economy as measured in PPP was $24,143 billion, eclipsing American output at $20,933 billion. The last time America fought a nation with a larger economy than its own was during the War of 1812. It was largely fought on American soil and the Redcoats did manage to set fire to the White House.

Had our Afghan adventure been limited to punitive strikes, saving $2 trillion, it’s possible that an additional $500 billion might have been invested military R&D and procurement, rebuilding the Navy, bolstering missile defense, and developing entirely new capabilities. Chinese adventurism would have been easier to deter. Instead, war on the scale the world hasn’t seen for 76 years is more probable than the elites who brought us Afghanistan, Iraq, Libya, Syria, and others would like to admit.