The Encyclopedia of Mormonism article on Emergency Preparedness explains that this practice is about simple pragmatism. It really has little if anything to do with eschatology; rather, the concept that members should maintain a stored supply of food is based on the simple reality that disasters and emergencies, both personal and wide-scale, do happen, and often without warning.
A person who has a long-term supply of food on hand is much better prepared to weather various disasters, ranging from a sudden loss of a job or unexpected medical expenses to societal disruptions such as natural disasters, riots, truckers' strikes or other conditions that make shopping for food difficult.
The recommended target given by the church is to have a year's supply of essential food saved up. The EoM article references a 1980 General Conference talk by Ezra Taft Benson, then of the Quorum of the Twelve Apostles, which can be found here. In the talk, however, he states that this has been the counsel of the church "for over forty years." (Which would most likely place the origin of the idea in the 1930s, most likely during the Great Depression, which makes sense. If anyone can find a source to date this counsel back that far, feel free to edit it in here.)