What does 民以食为天 mean?
First, as fefe said, this idiom should be “民以食为(wéi)天&quot; and it comes from 《汉书·郦食其传》“王者以民为天，而民以食为天。” (biography of 郦食其 in the historical record of 汉 dynasty). That sentence means &quot;People are the most important to an emperor, while foods are the most important to the people&quot;. Note that the correct pronunciation of the name is: lì yī jī
Why? Remember in ancient times, foods were not as sufficient as they are now (remember, even now some people in poverty are hungry all days), and foods are indispensable to the life.
Edit: More details
After reading that biography, I could explain more about the source. The context when 郦 spoke this was during the war time of 楚汉争霸, when he persuaded 刘邦 to occupy a city in which a lot of foods were stored. He spoke that to emphasize the importance of the foods (especially in the war time, if you don't have enough food supply, the soldiers won't fight for you, or even they would fight against you!)
Today, we usually use this proverb as an introduction sentence, when talking on the topic of foods. You would probably hear a sentence like this one from the host on the TV:

俗话说，“民以食为天”。今天，就让我给观众朋友们介绍几家以其特色菜闻名的餐馆吧。
It is popularly said that &quot;foods are the most important to people&quot;. Now, please let me introduce you some restaurants famous for their featured dishes.