It was big news last month when 7,000 U.S.-trained and -equipped Afghan security troops failed to defend the northern city of Kunduz against a far smaller Taliban force. Yet the setback is just the latest indication of American-trained foreign troops’ continuing inability to fight effectively on their own.

It should not have been surprising. Washington experienced this last year in Iraq. The United States spent $25 billion training and equipping a large Iraqi force, which then threw down its weapons and abandoned two key cities, Mosul and Ramadi, to Islamic State militants. Between 800 and 1,000 Islamic State fighters defeated 30,000 Iraqi troops.

This also happened in Vietnam in 1975. There, the U.S.-trained and -equipped South Vietnamese military crumbled in the face of a North Vietnamese attack. The South Vietnamese forces turned that country over to the communists in Hanoi.

We now see it in Syria as well. The U.S.-trained Syrian forces are not only not fighting Islamic State, they are instead joining with groups like Al Nusra, an al Qaeda offshoot.

These defeats should raise two questions for U.S. policymakers: Why does this happen? Why do we keep doing it and expect a different result?

Some argue, as did former Defense Secretary Robert Gates, that the U.S. military is both unable and unwilling to do effective training.

But this is not true. U.S. non-commissioned officers train young American men and women all the time — and regularly turn them into effective fighters in 12 weeks.

The reason that U.S.-trained foreign forces usually do not prevail is not because they are poorly trained and ill-equipped. In fact, they often have better equipment and far more extensive training than their opposition.

Yet they repeatedly fail largely because they are not as motivated. Military success on the battlefield is more dependent on whether men and women are willing to fight and die for a government they believe in. Rather than how well trained they are, troops have to believe their government is acting in the best interests of all its citizens.

The Iraqi and South Vietnamese troops did not believe this. Nor do the troops today in Afghanistan. The soldiers view these governments as inefficient, corrupt and sectarian. In other words, the troops do not see their regimes as worth sacrificing their lives for.

Knowing this motivational problem, why does the United States keep training foreign forces? The answer is simple: Washington does it so that it can evade conflicts it should never have gotten involved in in the first place, and then can pretend the United States has achieved its objectives.

In Vietnam, for example, it was clear after the 1968 Tet Offensive that the United States could not achieve its aim of creating a viable, independent South Vietnam — despite having 500,000 troops on the ground and 1.3 million personnel in the theater. Washington, therefore, began withdrawing its forces and turning the battle over to the South Vietnam forces that it had trained, a policy called Vietnamization.

The Nixon administration signed the Paris Peace Accords five years later, officially withdrawing all U.S. troops and turning the fight completely over to the South Vietnamese forces, designated as strong and capable enough to defend their own country. On paper, they were.

But the Nixon administration had trained the South Vietnamese military largely as a way to rationalize the U.S. withdrawal and justify the sacrifices of the 60,000 American men and women who died in that conflict and the 500,000 who were wounded. In fact, as President Richard M. Nixon signed the Paris Accords in 1973, he claimed it was “peace with honor.”

When the North Vietnamese launched an offensive on March 19, 1975, however, the South Vietnamese military collapsed more quickly than the Americans and even the North Vietnamese had anticipated. This was due to poor leadership of some of the units and to the fact that many South Vietnamese soldiers could not approach the North Vietnamese communists’ passion to win. Many in the South Vietnamese military also strongly believed that the United States would again come to their rescue.

Similarly in Iraq, when the invasion did not turn out to be the cakewalk that Vice President Dick Cheney and Defense Secretary Donald Rumsfeld had promised — and the United States had foolishly disbanded the Iraqi army — Washington had to begin training a new Iraqi force within months of the invasion. If not, the United States would likely have had to commit to a decade-long, large-scale occupation of a Muslim country. The U.S. policy became “As the Iraqis stand up, we will stand down,” President George W. Bush explained.

Unfortunately, because of the rise of al Qaeda in Iraq, which later morphed into Islamic State, the United States could not begin withdrawing its forces for another five years. But when it did, it left behind a supposedly well-trained Iraqi security force of 500,000 soldiers.

Afghanistan presents a similar situation. After the Taliban refused to turn over Osama bin Laden and his al Qaeda forces, the United States had no choice but to invade the country and remove the Taliban from power. But after accomplishing that, Washington decided to try to create an independent, stable government in a country historically regarded as the “graveyard of empires.”

As part of this, the American military knew it had to begin training a military force to provide long-term national security and to confront the Taliban, which had begun regrouping in Pakistan. But after increasing the U.S. presence in his first year in office, President Barack Obama set a deadline for U.S. withdrawal and accelerated the training of the Afghan security forces, now more than 300,000.

Yet this well-equipped force also cannot hold territory against the Taliban. Though Afghans have had a reputation of being fierce fighters for centuries, they still cannot win because the U.S.-trained Afghan security forces suffer from high rates of desertion. In addition, many officers are more loyal to their tribes or sects than to the central government, which they perceive as corrupt and ineffective.

One person strongly skeptical of the U.S. ability to successfully train foreign militaries is Obama, who has resisted many calls to leave tens of thousands of Americans in Iraq and Afghanistan indefinitely. Creating and arming a Syrian rebel force, Obama has insisted, is a fantasy.