I can't understand how a little defeat in Northern France could have reflected to the outcome of the whole war. I mean Germany defeated Russia and could have easily transferred the whole army from there to the Western front.
Not to discourage further discussion on this topic but I have written about this before in this post by me ( /u/superplaner ). Feel free to have a look through it and if you have follow-up questions after that I'd be more than happy to help.
Germany lost due to the combination of several factors.
To avoid war at many fronts at the same time, Generalfeldmarschalls Alfred Graf von Schlieffen came up with the so called Schlieffen-Plan. Important to note is that these ideas are from 1905 when Russia was still weakened from the war with Japan that just had ended. I will not get too much into detail here but long story short, the idea was to substitute a two-front war with two single front wars following each other back to back. The strategy was to defeat France first (moving over Belgium) within a few weeks and then to have all forces moved to the eastern front against Russia.
Based on these ideas the Oberste Heeresleitung made their plans almost ten year later. Von Moltke made a few edits but despite a very different political and strategical situation large parts of von Schlieffens plan remained unchanged. After a few initial successes the Schlieffen plan started failing at several parts: the invasion of the neutral Belgium caused Great Britain to enter the war against Germany. France was much stronger than 1905 (for example defense weapons improved a lot) and was able to defend themselves much better than expected. Russia moved their forces that invaded Eastern Prussia much faster than anticipated and, eventually, the two front war the Oberste Heeresleitung was trying to avoid was the status quo. This lead to the issue of over-stretching the German forces which caused a number of logistical problems concerning supply chains etc.) The combination of all these factors made the war much harder and less successful for Germany than expected. Also Russia was not really defeated as you said, but rather left the war due to internal reasons (October revolution 1917).
Another reason was the "uneingeschränkte U-Boot Krieg", which ment that submarines also attacked neutral trade ships. The goal was to disrupt trade between the British Islands - which certainly had a positive impact on the naval war situation for Germany, but ultimately led to the USA entering the war against the central powers (Germany and their allies).
In 1917 when Russia exited the war after a peace treaty with the Bolschewiks, Germanys army was already in an extremely bad situation. That was for all the above reasons plus the severe effects of the British seablockade. At this point victory was pretty much impossible, which is what the OHL admitted in September 1918, followed by the Armistice of 11 November 1918.