The ending of wars remains the same as always and will never change: the imposition of tremendous cost on the aggressor. That cost can come in numerous forms, including financial and domestic social (eg from human losses in the field), but that cost is overwhelmingly the primary thing that ends wars.
Covid plausibly more rapidly ended the US occupation of Afghanistan for example. It became increasingly politically untenable to disregard the cost of remaining in Afghanistan, while the US looks at raising taxes, deals with soaring budget deficits and mounting public debt (an ongoing context made sharply worse by the pandemic).
Most wars are fought due to resource scarcity - either commodity materials, food, or something else scarce.
Humiliating a country is often done through extreme resource extraction and/or subjugation (where existing resources are controlled, at a minimum, if not directly extracted).
Adding ideological humiliation on top of it can make the fire burn hotter once lit, but is rarely the direct cause.
WW 2 was a good hexample of this - the crushing penalties on the German economy + the ideological humiliation fed a fire the world has not seen for a long time.
But if Germany had been allowed to prosper, but been humiliated? Unlikely they would have been the aggressor. For evidence, see what happened Ww2, where that is essentially exactly what happened.
If they been made poor the way they were, but otherwise treated well? Hitler may not have been the figurehead, but someone would have, and a war would have been inevitable. It probably would have been less vicious and pointlessly destructive of lives and property - but not by that much.
I disagree with your first sentence - resource scarcity may happen and a country may be impoverished, but deciding to go to war is not an economic decision but rather a very personal one. Negotiations and deals are about resources, wars are about egos and beliefs.
Every war I’ve been able to find there was a clear resource issue that a ego, belief, nation identity, whatever reason was then pasted on top of to justify.
Even the crusades had a clear economic justification - massive overpopulation of fighting age males resulting in a shortage of jobs, opportunities, and money. Sending them off to die (and loot and pillage) solved both problems. Beliefs were used to paper over the obviously unpalatable reality on the ground and help recruit.
Besides whatever is captured, there are of course other things successful war gets you - fewer young men rattling around locally causing problems (including crime, revolts, general instability), your new ‘green’ military leaders get to cut their teeth in the field, ‘better’ female to male ratios for your traditionally male leaders, more space (aka conquered territory), looted riches and newly available natural resources, and it often reduces competition and neighboring populations that would get in your way within a region in general.
This doesn’t last that long obviously, as a generation or two later the population has again increased, your veteran leaders have retired, etc.
It’s not always so direct of course - most of the recent American wars are more about burning old excess material inventory, keeping domestic military manufacturing expertise alive, and ensuring domestic weapons manufacturers of all types are able to stay on the cutting edge, but it is still the same song and dance when you get down to it.
While you average solder may fight for a cause, a nation only goes to war when the books show it needs to happen.
Covid plausibly more rapidly ended the US occupation of Afghanistan for example. It became increasingly politically untenable to disregard the cost of remaining in Afghanistan, while the US looks at raising taxes, deals with soaring budget deficits and mounting public debt (an ongoing context made sharply worse by the pandemic).