On November 11, 1918 Germany surrendered, ending The Great War. It would not be known as WWI until after WW!! ended, for obvious reasons. Have you ever considered Germany's military position at the signing of the armistice?
Germany had won the war at the Eastern Front. On the Western Front, Germany still occupied northern France and Belgium. There was no fighting in Germany, the war remained primarily in France.
The Germans had moved with a major offensive early in 1918 and were repulsed, with the aid of the newly arrived American Doughboys. But for the most part, the lines on the Western Front were the same as they had been in 1916! As late as August of 1918, it looked as if the Germans were still winning. In September they were no longer on the offensive, but they were far from defeated. The war had not moved to German soil, The nation's industrial capacity had not been disrupted in any way. The means of making war were intact.
One could argue the leadership could see the writing on the wall, that Germany had spent its last efforts in the 1918 failed offensive. The flood of American men and materiel would tip the balance to the Allies. One could argue the nation was war weary, the costs of the war on the German citizenry was too much. Deprivations had already contributed to the booting of the Kaiser. There were severe food shortages. The industrial might of the nation was geared for war, not consumer goods. The losses in men and animals were staggering. There was not a village or family in Germany untouched by the terrible toll of the War in France. But the same could be said for England and especially France as well.
As American we tend to greatly over-emphasize our efforts in the Great War. I can think there is little doubt the influx of the American troops changed the tide of the German 1918 offensive, but the overall contribution was small compared to the British and French. The Germans came remarkably close to taking Paris in 1918, and the fall of Paris likely would have had such an impact on French moral they might have capitulated.
I think the German High Command knew they could not win and rather than bleed another million men and expose the German Homeland to the destruction of war, called it quits, akin to a heavy weight throwing in the towel in the 15th round. But no one, even with the hindsight of history, can claim the Germans were defeated in the fall of 1918.