The United States has spent billions of dollars training local military forces to fight in place of American soldiers and carry out the goals of American foreign policy. But time and again these efforts to build and train proxy armies have failed, sometimes spectacularly.

“Our track record at building security forces over the past 15 years is miserable,” Karl W. Eikenberry, a former military commander and U.S. ambassador in Afghanistan, told The New York Times.

The most recent example came in Afghanistan when the Taliban overran American-trained and equipped security forces in Kunduz Province. The U.S.-backed forces were forced to retreat.

The Department of Defense spent years rebuilding Iraq’s army after it was dismantled following the 2003 U.S. invasion. It was supposed to provide security for the country once the U.S. pulled out its forces. Then, the Islamic State swept in and seized key parts of the country because the American-trained Iraqi soldiers folded.

The U.S. suffered another embarrassment after it was revealed that spending $500 million to train Syrian rebels to take on the Islamic State “produced only a handful of soldiers,” the Times’ Eric Schmitt and Tim Arango wrote.

In Yemen, American-trained troops and counterterrorism forces crumbled against attacks by Houthi rebels who wound up overrunning the capital last year and forcing the government into exile. The battle is now being fought mostly via a Saudi-led air campaign which was resulted in more than 1,000 civilian casualties.

These failures often occur because local armies are being asked to put their lives on the line for regimes that lack legitimacy and fail to inspire people to fight for their country.

“The question is can we put a government in place that’s worthy of their sacrifice?” Richard Armitage, a former Pentagon and State Department official and Vietnam veteran, told the Times. “And if we can’t do that, they won’t die for their country, and all the training in the world won’t get you anywhere.”

Another shortcoming is that U.S. forces are trained to fight wars, not to train others to do so. “We want to kill people and break things; we don’t want to train, advise and equip our allies,” John Nagl, a West Point graduate, Rhodes Scholar and combat veteran, told Bloomberg. Nagl calls inadequate training of Iraqi and Afghan units “the single biggest military failing of the last 15 years.”