Before the outbreak of World War I, several European nations had begun preparing for what many of them thought was an inevitable conflict. Out of all of them, Germany was the most mobilized out of all of them.
First, Germany had seen the conflcit as a way to end territorial disputes with its rivals while at the same time creating a more stable government by uniting the people behind the monarchy. As you can see Germany had considerd the long-term benefits of the war more than most other nations.
They also had a strategy that they felt would secure them a quick victory. Known as the Schleiffen Plan, it called for a quick end to the war on the western front to prevent the possibilitiy of a two-front war that would spell doom for Germany.
The one area where Germany's planning fell short was material in nature. Germany was not prepared to get bogged down into a two-front war, and therefore did not prep its economy for wartime. Food wasn't properly regulated, which resulted in starvation, especially after the allied blockade of 1919.