In the spring of 1918, victory seemed to be within the Kaiser’s grasp. Allied troops were war weary. There were mutinies in the French army involving more than 40,000 men. U-boats were sinking an average of half a million tons of shipping bringing supplies to Britain. At the battle of Caporetto, 260,000 Italians had surrendered to the Austro-Hungarians and 400,000 fled. Russia was out of the war.
With a superiority of more than two to one in men and guns, the Germans launched their spring offensive on March 21, firing more than three million rounds on the first day. The long stalemate in the West was broken. On April 9, a further German attack was followed by an advance on Paris, creating panic in the city. By the end of June, the Allied military leadership was traumatized. Three months later the Germans were suing for peace.
The first reason for the astonishing reversal had to with military intelligence. The Germans never established an effective espionage network behind Allied lines. The Allies on the other hand were well prepared for German attacks after the initial ones.
The second reason: the war in the air was now being won by the allies. It extended well beyond the front lines. By the summer of 1918, the Allies produced many more planes than the Germans who no longer had sufficient raw materials.
Third, there was a shift in the balance of power where the gas war was concerned.
Fourth, by the summer, the Allies changed their offensive tactics, using artillery not to obliterate but to neutralize pin-pointed enemy positions.
Finally, the economy and the home front. The Allies out-produced the Central powers dramatically, and the Allied blockade cut off essential agricultural products. By 1918, the death rate among women in Germany was nearly a quarter higher than before the war. Conditions were even worse in Austria-Hungary where soldiers were often weak from hunger. In Bulgaria, mass starvation was averted only by American grain deliveries after the armistice.
When it became apparent that a military victory had eluded the Germans, they were paralyzed; the possibility of anything other than complete victory had never occurred to them. They had believed their own propaganda. Moreover, they were terrified of a revolution at home.
Another reason for the sudden collapse was Germany’s tendency to give excessive influence to technicians consumed by hubris. They were inadequately restrained by politicians whose judgment was generally superior.
Source: Richard J. Evans review of David Stevenson’s With Our Backs to the Wall (London Review of Books, December 15, 2011)
Eric Koch’s book, The Weimar Triangle, is available at Indigo-Chapters and in your local bookstore. 
I watched a British documentary on this a week or two ago. It gave the reasons you detail but added that the German lines were overextended. That worked in 1940 in France. Also the documentary pointed out that the Americans provided the manpower and enthusiasm to push the Allies over the top.