The war ended after a bruising war of attrition and virtual stalemate. Two events changed the picture. First, Russia withdrew from the War following its Revolution and virtually surrendered to Germany under the Treaty of Brest-Litovsk. Secondly, the infusion of fresh troops from America together with the full resources of the American military was too much for the war weary axis powers.
Germany gained a brief respite after the surrender of Russia at Brest-Litovsk. Shortly thereafter, the Germans launched a major offensive against French lines, but the offensive was turned back within 35 miles of Paris at the Second Battle of the Marne. Allied success was largely the result of the infusion of fresh American troops who did not suffer from the war weariness that plagued the other forces. Both sides were weary of the war, but it was the Germans who cracked first.
After the Russian Revolution, a series of major strikes broke out in Germany, mostly led by Socialists and Communists. In July, 1918, a coalition of moderates in the Reichstag passed a peace resolution calling for peace without territorial annexation. In response, the German military cracked down with a virtual dictatorship of the homeland. With the Allies advancing on all fronts, General Ludendorff realized that the war was lost; but insisted on blaming moderate politicians in the Reichstag for the defeat. On October 4, 1918, a new liberal government met to sue for peace; however President Woodrow Wilson responded that he would only negotiate with the democratically elected government of the German people. The German people had had enough, and rose up in rebellion. Soldiers and workers began to establish revolutionary councils on the models of the Russian Soviets. On November 3, sailors in Kiel mutinied and on the same day Austria Hungary surrendered to the Allies. Masses of workmen in Germany struck and demonstrated for peace. Faced with unrest and with army discipline collapsing, Wilhelm II abdicated and fled to Holland, where he remained to the end of his days. A German Republic was proclaimed on November 9, and agreed to the Allied terms of surrender, which were NOT generous. Allied and German representatives met at Compiegne near Aix-la-Chappelle, (present day Aachen) in a Railroad Car where the Armistice was signed at eleven a.m. on November 11, 1918. The War was over.
Basically, WWI ended with the entry of the United States. This is not to say that the US was in any way superior to the countries that had been fighting. However, the entry of the US broke the stalemate that had been in effect on the Western Front for so long.
On the Western Front, the Germans and the British and French were so evenly matched that neither side was able to get anywhere. Given this situation, it is not at all surprising that the entry of the US had such a great effect. The US Army was big enough that its introduction into the war completely tipped the balance of power. Within a few months of the time that US forces first got to France, the war was over.