Germany was forced to surrender in World War I primarily due to tactical mistakes made late in the war and dwindling food supplies due to British blockades of the country's ports. Germany also lost many of its allies to armistices in 1918.
Germany began a large-scale attack in 1918 called the "Spring Offensive." Its intent was to capture Paris and force France to surrender while simultaneously outflanking British forces along the North Sea coast. The initial advances were successful, but the troops moved too far ahead of supply lines, and the most seasoned troops were taking the worst casualties at the front of the assault. Allied forces eventually broke through the German lines and forced them to retreat.
The entry into the war of fresh American, Australian and Canadian troops in 1918 coincided with the surrenders of German allies Bulgaria, the Ottoman Empire and the Austro-Hungarians. Germany found itself increasingly isolated and outnumbered.
Germany's cities suffered most greatly from the lack of food, with starvation deaths in the country increasing by 200,000 from 1917 to 1918. There were also outbreaks of dysentery. Poor domestic conditions led to internal revolution in November of 1918, when a dozen major cities were taken by rebels. This led to the abdication of Kaiser Wilhelm and armistice negotiations shortly thereafter.