Bro,
The notion of victory or defeat is decided on the basis of the fulfillment of the CORE political objective of the war. Any war is fought in pursuit of a political military objective.
Afghanistan
Why US invaded Afghanistan? To punish those deemed responsible for 9/11. To dismantle Al-Qaeda Network.
(1) Do you see Osama Bin Laden alive and suicide attacks in American cities? OR (2) Osama is dead and much of the Al-Qaeda Network is gone? (1) is true.
Many of the Afghan Taliban also died in this war. But Pakistan saved these people. Pakistan had provided US access to Afghanistan so Pakistan wanted to have a say in Afghan Affairs.
Donald Trump was fine with finding a political solution for Afghanistan that was acceptable to Pakistan. But Afghan Taliban were allowed to return to power in Afghanistan because they agreed to not allow Afghan soil to be misused for plots against US. This clause is in the deal that was signed between US and Afghan Taliban.
Americans have accomplished their CORE political objective in Afghanistan but Joe Biden created embarassing optics of a very rushed withdrawal process from Afghanistan. An incompetent political coward at the top is responsible for this embarassing development.
Now Biden is showing spine in Ukraine to rebuild his reputation. Funny.
Nevertheless, Pakistan continues to find and fight terrorists in Afghanistan. And Pakistan's economy has gone to the dogs lately due to ill-advised political experiments. If Hamid Gul had been alive to see this....
Korea
Why US invaded Korea? To liberate South Korea that had fallen to a well-prepared North Korean military machine in 1950.
How this war concluded? It concluded with liberation of South Korea and the communist bloc had to come to terms with this reality in writing. This is straightforward battlefield victory.
It is true that China saved North Korea (an achievement that the Chinese have every right to celebrate) but China will not tell you about defeat in Seoul and other regions of the war which led to restoration of South Korea in the end. In fact, South Korea absorbed some parts of North Korean territory in its restoration.
Don't draw conclusions about this war from a Chinese movie. It caters to domestic audience and consumption. Read my historical guide instead.
Vietnam
Why US invaded Vietnam? To preserve South Vietnam.
But Vietnamese geography made it impractical for US-led forces to conduct WW2 style armored thrusts and sweeps in this region.
US-led forces eventually adapted to Vietnamese conditions and began to produce results on the ground.
But Lyndon B. Johnson showed weakness in the face of American military victory in the strategically important A Sau valley in 1969.
And Richard Nixon showed weaknes in the face of a brilliantly executed Operation Linebacker in 1972 - a military operation that almost shattered Vietcong and brought it to the negotiation table. Nixon chose to withdraw and South Vietnam fell in 1975.
Vietnam also shows that incompetent political cowards are responsible for defeat in a war that could be won in the battlefield.
Iraq
Why US invaded Iraq in 1991? To liberate Kuwait.
How this war concluded? It concluded with liberation of Kuwait. This is straightforward battlefield victory.
Why US invaded Iraq in 2003? To dismantle Saddam regime and reboot Iraqi political system.
How this war concluded? It concluded with defeat of Saddam regime and reboot of Iraqi political system. This is straightforward battlefield victory.
Iraq wasn't easy to tame and reform but Americans showed commitment to this front and it paid off eventually.
Iran also have some Iraqi elements in its pockets but this is the price to pay for a country that has internal faultlines and only a strongman like Saddam could put a lid on them.
-----
US has ample military muscle but American leaders are very mistaken in assuming that democracy can be exported to every country out there.
Democracy works in some environments, not everywhere. A strongman can be the right leader to bring to power to secure a country at earliest. Iraq could be much better managed by "restoring" Iraqi army for example.
The alternative is to be brutal like the Wehrmacht to secure a country. This would be possible if US scrap its "Theory of Limited War."
@gambit