Which cases were there of a country losing a war but still finding itself in a stronger geopolitical situation after the end of the war than before the war? I can think of Germany after the end of World War I, when it was in a stronger geopolitical position after the end of the war than before the start of the war due to the fact that Russia experienced a revolution and went Bolshevik in the middle of WWI. While this was obviously extremely bad for Russians themselves, it was actually quite good for Germany since before the war Germany was encircled by the Franco-Russian alliance whereas after the war this was no longer a problem due to the termination of this alliance (and since Czechoslovakia and Poland simply couldn't compare to Russia). Since Bolshevik Russia was an international pariah, it was difficult for it to find any allies, and it actually found common cause with Germany in revising the post-World War I peace settlement, which was favorable to neither Germany nor Russia.
Anyway, which additional examples of this can you think of?
Anyway, which additional examples of this can you think of?