“I will not send another generation of Americans to war in Afghanistan.”

With those words, President Biden made it clear that America’s “forever war” would be completed by Aug. 31. After more than 2,000 U.S. dead, a war that is old enough to vote in a place most Americans couldn’t find on a map will soon draw to a close. And it is ending in failure, with the Taliban retaking control of Afghanistan, just as it did in 2001 when the United States invaded.

A shadowy force that had risen from the chaos of the Soviet Union’s defeat, the Taliban was a no match for the U.S. military at the beginning of Operation Enduring Freedom in 2001. Yet, underneath the facade of military amateurishness and a quick initial collapse lurked a hardness born of generations of conflict. Doggedly the Taliban and its military continued to exist, with the help of several regional powers aligned against U.S. goals. And in the weeks since the announcement of U.S. withdrawal, it has made stunningly rapid gains, culminating in the takeover of Kabul on Sunday.

This conjures up a dramatic scene from a half-century ago — one that told a sobering story of a wartime failure that once seemed unimaginable. A single helicopter sat precariously on a Saigon rooftop in 1975, rescuing desperate stragglers as the war in Vietnam collapsed into ultimate ruin. After a decade of struggle, and over 58,000 Americans dead, South Vietnam was no more. While most Americans were shocked at the rapidity of South Vietnam’s demise, those who had followed the unfolding of the war closely knew that the end was coming. They also knew its cause: The United States hadn’t helped build a sustainable South Vietnamese government and military, something that seems to have happened again in Afghanistan.

The Geneva Accords of 1954 and the ouster of the French from Southeast Asia brought to life the country of South Vietnam. Throughout its short history, the fractured young nation, like the Afghan government today, faced an internal threat, the Viet Cong, and an external threat, North Vietnam. Both of these threats were aligned with China and the Soviet Union as part of the Cold War contest with global communism. As the 1950s closed, that prompted U.S. policymakers to deem the survival of South Vietnam critical to U.S. national security.

By 1960, the United States turned its eye to the creation of a South Vietnamese military that was a smaller carbon copy of its own — a military based on lavish use of firepower and endless supplies. In short, it would be a rich nation’s military.

It was the simplest and most immediate solution to a threat that most Americans gravely underestimated. The result was a military, dubbed the Army of the Republic of Vietnam (ARVN), that won battles on the strength of massive U.S.-supplied firepower. But the ARVN was never linked closely enough to its people or nation, and it wasn’t sustainable.

This poor fit was an outcome of the United States simply not focusing on creating sustainability in South Vietnam. Instead, U.S. military leaders were narrowly focused on immediate battlefield success. As Gen. Maxwell Taylor, former chairman of the Joint Chiefs of Staff and ambassador to South Vietnam, later reflected, although the United States wanted to win battles: “We never really paid attention to the ARVN Army. We didn’t give a d--n about them.”

The fatal strategic flaw was assuming that winning battles, from the Ia Drang Valley in 1965 to Tet in 1968, to the Easter Offensive of 1972, would win the war.

Yet, beneath those victories was dysfunction. The South Vietnamese government lurched from crisis to crisis, mired in graft and infighting. The ARVN’s leadership was deeply politicized. Both left the South Vietnamese people with little faith that their government and military could protect them — and little passion for either.

Without this public trust and a South Vietnamese state capable of and worthy of surviving on its own, the United States had constructed an ARVN that could win battle after battle with U.S. aid, but one built on quicksand. Its military successes were not enough. In the end wars demand political, not military, solutions.

Additionally, these military victories couldn’t continue without U.S. military might — especially air power — underpinning the ARVN efforts. And the United States knew it.

Everyone from the CIA in 1968 to Gen. Creighton Abrams, commander of U.S. forces in South Vietnam, in 1969 to President Richard M. Nixon in 1972 acknowledged that South Vietnam was too fragile to survive without U.S. military support. As Nixon and national security adviser Henry Kissinger plotted America’s exit from the war, Kissinger agreed with his boss’s assessment that it would doom South Vietnam but added that the country was a backwater and “no one will give a d--n.”

So it was that in 1973, after over a decade of battlefield victories but with no end to the war in sight, and with the U.S. public exhausted after the loss of over 58,000 U.S. service members, the United States ended its war in Southeast Asia.

Realistically, the United States only had two other options, one of which, brute force, was no choice at all. Visiting total destruction on an entire country and risking nuclear war amid the Cold War was never a viable strategy.

That left sticking it out for a long war, one that perhaps would have persisted to this day, and working with South Vietnam more as equals with a deeper understanding of what was possible in that young nation. America, though, had little appetite for the human and economic cost of a war that might last generations and would have involved the slow slog of real nation-building efforts instead of sharp battle victories that grabbed headlines and provided immediate, tangible results.

Even worse, after the helicopters left Saigon in 1975, America did its level best to forget the lessons of our misbegotten adventure in Southeast Asia. The military pivoted to technology and maneuver to win short sharp wars, hoping never to face a war like Vietnam again.

But in Afghanistan, a war that began quickly after the terrorist attacks of Sept. 11, 2001, the United States again confronted a long war without front lines. In another eerie parallel to Vietnam, the conflict occurred in a place few Americans understood in service of a nation that had little hold over its own people and alongside an Afghan military of dubious ability and motivation. Many battles were won, and an Afghan army was created that mirrored our own. But those victories and that military sat atop a rickety national structure, one full of corruption. Afghan politicians commanded little loyalty from the public, and the government collapsed in a matter of days without U.S. support.

The lesson of Vietnam — and Afghanistan — is that the United States can’t win wars for nations with weak governments battling against internal turmoil and external threats. Absent total war — with zero regard for civilian body counts — victory requires the construction of indigenous militaries that can survive without the United States in service of governments that are worthy of their people’s sacrifice. Whether the United States can parachute in and build such militaries and governments is an open question, but one thing is certain: At the very least, doing so would require U.S. politicians of better understanding and then explaining the need and rationale for an open-ended military effort. After all, how many Americans can offer an explanation for why the United States should have remained in Afghanistan?

Winning battles is both flashy and necessary, but real sustainability and, thus, victory can only come with a deep understanding of indigenous cultures, a thorough and long-term alliance and the building of a stable government that gives its people security and hope — and commands loyalty.

When the United States contemplates launching wars like Vietnam and Afghanistan again in the future, only understanding this reality will allow the United States to avoid repeating the past again.