The First World War was a huge event which ended abruptly; going from huge German advances after March 1918 to Germany asking for peace later that year: they were forced from a hard hitting offensive to defeat for various reasons:
One of the key reasons for Germany's defeat is the internal problems suffered by Germany from late 1917. Morale in the ranks of the Germany army was diminished to a painfully low point: they were exhausted from the spring offensive and on low morale from the turn of the tide at 1918 and the new of the entry of America into the war on the Allied side. Germany was suffering overall supply problems: There were food shortages for over a year, coal became in short supply and consumer goods were very hard to get hold off. Industrial output had fallen by up to 57% by the end of the war; the German people as well as the Germany army were running out of supplies and the army of munitions. The outbreak of Spanish influenza, in particular, made matters far worse. Exhausted, ill, low morale and under-supplied troops do not fight well; especially in the face of a well stocked enemy. …