It should perhaps be pointed out that the terms dictated by the Treaty of Versailles were far less harsh than those demanded by the victorious Prussians over the French, after the Franco-Prussian War of 1870.
The sheer fact that Germany was not invaded or occupied, that the war ended by armistice, rather than unconditional surrender, helped fan the ‘stab-in-the-back’ myth that provided the cesspool for the Nazis to flourish.
We would not make that mistake again with WWII.
Parts of Germany were occupied (Ruhr, Rhineland), other parts were simply taken from Germany, Austria-Hungary, and post-Tsarist Russia (to re-create Poland).
The “stab in the back” was credible to many Germans because they rarely lost battles; even the armistice was signed while Germany occupied its enemies’ land. The “stab in the back” was primarily laid at the feet of leftist agitators destroying the war industries at home with strikes (depriving the soldiers of needed munitions); the signers of the armistice were simply the last step.