Food shortages are a serious risk, even for Western economies. The world food price crisis in 2007 and 2008 gave us a taste of what things could look like, including food riots. Governments can't seem to resist fiddling with the market for food, which causes many more problems than it solves.
Look at Britain, for example. A while back, the government mandated that pig farmers reform the way they raise pigs to make the process more "humane". As a (totally predictable) result, raising pigs became more expensive. The farmers were unable to pass the costs along to the public, who, presumably, wanted the changes in the first place. So a lot of farmers stopped raising pigs. Their breeding herd declined to about 425,000, or roughly half the size it was in 1990. Combine that with a run-up in grain prices, and presto! There's a crisis with pigs.
No government ever seems to ask "who will pay for this?" or "what will the effects be?" Unfortunately, even if they did ask such questions, their answers would usually be wrong. The economy is just too hard to predict. That's one reason why free markets are the only viable long-term answer. In the case of pigs, if people wanted farmers to treat pigs more humanely, they could have boycotted farmers who didn't, and expressed their willingness to pay a higher price for better animal conditions (analogous to organic produce). The market would have communicated the message. No shortages would have developed.
Now the same kind of thing is happening with other foods. The government says "if you grow corn for biofuel, we'll give you a subsidy." After all, biofuels will help reduce our dependency on oil, and that's a good thing, right? So farmers replaced wheat with corn. Now there's a wheat shortage. Oh, and it turns out that corn-derived ethanol isn't an economically viable substitute for oil after all. So now we're screwed three ways: not enough wheat, ethanol that takes more energy to produce than it delivers, and more government debt / inflation. Again, this just wouldn't have happened in a free market.
What about food aid to developing countries? Those people are hungry, and they deserve our help, right? We're richer than they are, and we can afford it, so it has to be a good thing, right? Wrong. Food aid actually does MUCH more harm than good. For one thing, the money never goes to the people who it would really help the most. Corruption is rampant.
Let's say the money is used to buy food on the open market and deliver it to poor, downtrodden communities. First, the extra demand for food drives prices higher for everyone else, so the people who aren't receiving aid suffer as a result. Second, how can a local farmer compete with free food? When continued over a long period, farmers are driven out of business.
As Jim Rogers explains in his book Adventure Capitalist, there used to be a lot of farmers in Ethiopia. It has rich, fertile land. Lots of free food over the years has driven the farmers out of business—there are probably few people there now who even remember how to farm. So, if there's a global food shortage, where the food programs are no longer able to afford to buy food in the open market, guess who suffers? The people in those countries you thought you were helping will starve, because they've become dependent and can no longer support themselves. Yeah, food "aid"—another collectivist crime against humanity.
So what's the cure for food shortages? Stop subsidies. Stop interventions. Abolish tariffs and other restrictions on free trade. Repeal or minimize government restrictions on farmers (like legislating how pigs are treated). Fight corruption. Let the free market work!