The answer to this question is different for the various countries that were directly involved in World War I, so to provide a blanket answer is not easy. However, there were certain patterns which historians consider when examining how World War I affected the economic stability of those countries.
First, World War I was the first "type" of war of its kind in several ways. It was a "total war," which means that the countries directly involved (Britain, France, Germany, Austria/Hungary, Italy, Russia, and eventually the USA) transformed their economies to facilitate fighting the war. It was also one of the first truly mechanized wars, to some extent. This meant that the production of specialized equipment was necessary for countries to stay in the fight. It was also a war which was fought in the context of already existing arms races and very complex international trade agreements between countries. If we consider all of this, we can find at least some patterns which provide us with a fairly adequate answer to this question.
Factories worked overtime to provide the mechanical equipment for the war, in most countries. In France and Germany, factories produced large quantities of weapons (field guns, shells, rifles, ammunition) whereas in Britain, much of the mass-produced goods were imported from the USA. Specialized work was often contracted out to private manufacturers. This meant that many wealthy businessmen profited from the war. Finally, one of the main problems of factory production was labor, which is why women made an important contribution to labor.
Farms and mines worked overtime because the factories needed the raw materials to produce the goods needed to maintain the armies. Russia was largely self-sufficient in this area because it was still mostly a peasant economy before 1917. The British coal industry exported a great deal of its produce to France, and the American oil and steel industry had a market in the UK. Farms were more problematic. Armies had swallowed up many young men from the countryside, which left farms with labor shortages across Britain and France. In addition, many animals had been requisitioned by governments, which led to farmers struggling to produce the food needed for the war economy. As a result, rationing was commonplace in most Allied countries. Germany experienced huge food shortages by 1916.
In short, World War I transformed the economies of those involved. Many private businesses profited from the increased demand for production, but eventually, the strain that was placed on the economy led to widespread collapse, which many historians argue was the main factor in bringing about an end to the war. Quite simply, Germany could not keep up and was forced to surrender. Labor was certainly the biggest challenge, but this was coupled with more complex economic factors such as shortages of goods and food, high prices and fluctuating taxes.