The First World War ended when an armistice was signed between the Germans and the Allies. At that point, while Germany had no realistic hopes of winning the war, they had no enemies within their borders and still had troops in enemy territory.
I believe this apparent "victory" exacerbated the belief that Germany was betrayed by civilians at home (ie: the Dolchstoßlegende). The armistice wasn't officially a surrender, but apparently the terms were not very good for a country that wasn't really defeated.
So, how unfavorable were the terms of Germany's "surrender" in WW1?