Germany seemed to be a favorite at the beginning of the war in 1914 and in early 1918 the French didn’t believe that they were capable of winning the war anymore. What factors contributed to this sudden change.
This one's a doozy, and rather complicated, but I'll give my two cents on this.
One rather important factor was at the beginning, when von Klück opened a gap between himself and von Bülow, allowing the French to throw themselves in between the First and Second German Armies, concentrating against each in turn and driving them back at the Marne. During the beginning of WW1, Germany followed the Schlieffen Plan to a tee, they marched through Belgium and into France, pushing the British and French back until the Germans stood close to Paris, a mere 40 km from the French capital. It should also be noted that while First and Second German Armies decision to split up was, in hindsight, a fatal mistake, the Belgians fought much better than Germany had expected and this also proved an obstacle to properly carrying out the Schlieffen Plan.
The French-British counterattack, as mentioned, pushed the Germans at the First Battle of the Marne, which Germany lost and the war descended into trench warfare until 1917.
During these years, the Central Powers suffered because of the British blockade, but I'd argue that Ludendorff's economic initiatives was equally bad, or even worse. It's possible that Germany could have been self-sufficient in foodstuffs, or could have drawn upon other sources like Romania, Hungary, and western Russia (after the defeat of Russia).
But Germany and Austria committed the same folly that Russia did, and it led to the same results. They put too many men in the factories and in the trenches and too few on the farms. And since they couldn't make good by imports, all three of them suffered serious food shortages. *
This admittedly would have happened to France too, and possibly Italy and England, were it not for the British Merchant Marine and the United States. The French actually mobilized an even higher proportion of their manpower than Germany in percentage (slightly above 8 million out of 40 million for France, and about 11 million out of 68 million for Germany), but France has a nice Atlantic Coast and the British could carry food for them all across the planet.
Another common trope I have encountered is the German cultivation of the idea that they lost the First World War because of their allies (Austria-Hungary in particular) and their poor performance, and that that was a big reason why the war turned against them. And yet, from the outbreak of the war until the Spring of 1915, almost the entire Austro-German border against Russia was guarded by Austria-Hungary, with mere token German troops in East Prussia.
The Battle of Tannenberg, while being one of the most well-known battles of WW1, taking place in August 1914, only occupied 150 000 German troops, while at the First Battle of the Marne, Germany had 900 000 soldiers. The campaign for East Prussia unjustly overshadowed the simultaneous struggles between Austria-Hungary and Russia in Galicia. By comparison with East Prussia, the battles in Galicia in 1914 involved more Russians: four armies instead of two, and double the number of component corps. They fought against more troops of the Central Powers: at first three and then four Austrian armies, instead of one German.
Of course, it must also be noted that Austria-Hungary made several fatal mistakes which eventually forced Germany to shift more troops there. Technically Austria-Hungary could have concentrated first against Serbia almost without undue danger, as the Carpathians were a formidable barrier to Russian invasion and could have held them for some time even with inferior forces.
But the A-H Army made unnecessary offensives into Russia, rather than stay on the defensive. The invasion of Serbia was also poorly executed, though this can largely be attributed to the High Command. The troops from first to last fought with loyalty and valor. For example, at the Battle of Cer during the first invasion, the largely Czech 21st Division, commanded by the Polish officer Arthur Przyborski, fought with desperate courage against the seasoned veterans of the Serbian Combined Division under Mihailo Rašić. The reason for the defeat was a Serbian surprise attack at 1 A.M. with bayonet attacks. Attacking at night with bayonets was a Serbian specialty, that they used during battles such as Kumanovo, Bitola, the Bregalnica, and others. The High Command apparently did not study this, a serious oversight.
To sum up, there were several factors behind the defeat of the Central Powers. Germany arguably made the most fatal one, when they allowed themselves to give the French and British the respite and opportunity needed to counterattack in 1914.
I do hope that this will answer your questions, otherwise get in touch and I will try to expand upon it.
* = 'The Rise and Fall of the Great Powers: Economic Change and Military Conflict from 1500 to 2000' , Paul Kennedy