What was it that there was widespread rationing during the world wars? Presumably the food supply was damaged, but how? Was it that farmers went to the front lines, that distribution networks were destroyed, that farms were burned, that supply convoys got attacked?
Rationing during the world wars was more a means of removing products necessary for social stability and continued war-fighting capacity from the market. Prior to 1914, the world created a more or less global food supply system: Britain relied on foreign sources for something like 80% of its caloric intake, and while that was the most extreme case, there was a worldwide trade in all kinds of foodstuffs. These included preserved, refrigerated, and fresh meat and dairy, sugar, spices, coffee, tea, fresh and preserved fruit, and above all, grain. Prices had converged globally in the previous 50 years, indicating a system whereby regions or countries relied on imports and/or exports each year. For importing countries, the problem of losing supplies was obvious: shortage. But even for exporting countries, it was not so simple. A country (a Caribbean island, for example) might export a great deal of something (sugar, say), but would rely on the income from that to allow its citizens to buy their daily consumables on the market, and thus a disruption of international commerce was just as problematic.
Both sides recognized the importance of food supplies to the war efforts--without food, a country could not fight--and pursued strategies accordingly. The Central Powers in World War I and the Axis countries in World War II faced blockades from the British and later American navies, so that very little commercial shipping made it into those countries in either war. On the other hand, the German navy put tremendous effort into submarines, which were used to attack primarily the commercial links between Europe and North America in both wars. In particular, they attempted to disrupt the supply of North American grain to Britain.
Wartime conditions introduced a much greater level of uncertainty, and the disruptions in international commerce meant that normal fluctuations in supply (demand for food is generally inelastic, though some products are better seen as luxuries) could not be made good through the market. Thus, prices either rose or threatened to rise, sometimes quite dramatically as in Britain in the first few years of World War I. This posed problems on multiple levels. First, beyond the need for food, the major combatants adopted what has been called "war socialism," basically centrally-directed production in order to ensure that the necessary amount of war materials. The free market was not trusted to respond quickly enough to the immediate and even transformative needs for munitions and war-fighting materials, most of which were purchased only governments and for which there were not flexible systems of supply and demand. In the context of major countries turning to more-or-less command economies, predictable prices for food were essential; their whole ability to set production relied on relative predictability of costs and prices.
Second, in the context of wars that required the total investment of all national resources, human bodies themselves were important resources. This is obvious at a violent, marco-level in the ways that the major combatants first deployed the largest armies they could in the First World War, and then attacked each others' populations directly in the Second: strategic bombing, submarines, death squads and Holocaust. At the micro-level, this meant it became more necessary than ever before to ensure a well-fed population. The industrialization of Europe in the 19th century had generated tremendous wealth but also tremendous poverty, and this was evident in the bodies of the working classes. While conditions in 1914 were not as bad as they had been in the middle of the 19th century--the benefits of fossil fuels and global food supplies were trickling down to the lower echelons of society--there was nevertheless a discernible gap in both diet and physique between rich and poor. The rich ate opulently, devouring great amounts of expensive foods at ostentatious feasts: think Downton Abbey's dinner scenes. The poor ate sparsely, sometimes as little as just bread and tea or coffee, or frequently getting by on a combination of cheap starches like bread and potatoes, with cheap, processed proteins like canned meat. When thousands of Britons attempted to sign up for the army in 1899, during the Boer War, it turned out that something like one third of working class recruits were turned away outright due to deficiency diseases, poor teeth and eyes, and other physical problems. The poor were several inches and 15-20 pounds lighten on average than their middle- and upper-class countrymen. When a country needed to deploy every able-bodied man either as a soldier or war-worker, such problems were unacceptable. Rationing was a way to ensure that everybody--literally every body--was well-fed. There was particular attention paid to prenatal and child health, since those were the next generation of soldiers. But, overall, rationing served as a leveling influence on diets. The poor in many countries (though perhaps not in Germany or Russia) likely ate better during the wars than they had at any point in the 19th century.
So, for all these reasons, rationing was adopted by the major combatants. The free market could not operate, and threatened a level of instability and unpredictability at a moment when the very survival of the state was at issue. As such, rationing removed food from the market, and placed it in a centrally-organized system, which in many cases outlasted the wars (bread was only rationed in Britain from 1946 to 1948, if I recall). Indeed, the systems of rationing developed during the wars are sometimes regarded as important experiences in developing post-war welfare states.
Edit: Apologies for the atrocious grammar. That's what I get for knocking out a long post quickly and without revisions.
Basically all the above. Especially for Germany it relied almost entirely on imports for food. Suitable land to farm has been the achilles heel of German history since their unification and it drove them into ruin in the two world wars -- especially in the first. By beating Russia and creating a Ukranian puppet/buffer state she hoped to get an influx of food from their grain fields but that took until Spring 1918 to occur -- right when their offensives in the West were grinding to a halt and the 100 Days was about to begin which would win the war.
Britain quite literally starved the Germans out and what little remained had to be used sparingly. Do you give it to the citizens on the home front or do you give what you can to those fighting on the front so they can be in the best shape? Which front do you sacrifice? The Germans decided, as did everyone else who had to decide, the soldiers needed the food more. Only 1/3rd of the grain was given to the non-military personnel who comprised 2/3rds of the total population. As for other staples they only had 15% the amount of meat available compared to pre-war levels and that number for fish & eggs is in the single digits. While the rural areas could cope with this (as they grew their own food and just sold off the rest) the urban areas were devastated. When I say men were starving to death on the job in their factory, I'm being serious. Dysentery, starvation, and murder over a few ounces of bread were not uncommon. Germany was a country that relied on imports to survive.
Hew Strachan talks about this in depth in his work The First World War: Volume I: To Arms in numerous chapters so if you want more I'd suggest going there.