Hmmm, let’s see. Let’s just look at US wars.
Revolutionary war: British lost, government retains power.
War of 1812: Tie, both sides retain power.
Mexican-American war: Mexico lost, loses northern possesions, government retains power.
Civil War: South lost, goverment falls.
Spanish-American war: Spain lost, loses colonial possesions, government retains power.
WWI: Central powers lost, German government falls, Russian government falls, Austria-Hungarian government falls, Ottoman empire government falls.
WWII: Axis lost, German government falls, Italian government falls, Japanese government falls, whole host of other countries occupied and reorganized and boundaries redrawn.
Korean War: North Korea lost in bid to take over whole peninsula, government retains power.
Vietnam War: US lost, US government retains power (Even if you counted Nixon, he didn’t resign over Vietnam).
Panama: Noriega lost, lost power
Gulf War I: Iraq lost, Saddam retains power.
Afghanistan: Taliban lost, lost power
Gulf War II: Iraq lost, Saddam lost power.
So even counting just these US wars, in 7/13 listed cases the losing government did not lose power.
We can perhaps categorize wars in three ways. Wars between roughly equal powers, where the winner gains some territory or concessions or reparations, but is not strong enough to force anything more sweeping. Wars between strong powers and much weaker powers, where the losing entity becomes a vassal state of the stronger power with a subservient new government, or is annexed completely. And wars between collections of powers, such as WWI, WWII, or the Napoleonic wars, where the winning side is in a position to totally reorganize the political situation in the losing powers and redraw boundaries at will.
But even in one-sided blowouts like the Spanish-American war the losing side doesn’t always or usually face occupation of its capitol and the detention of its rulers. The losing government might fall, not because the winner is installing a new subservient government, but because the population of the losing side is holding government accountable.