(covers information from several alternate timelines)
Rations, or food packs, were controlled portions of certain foodstuffs, distributed in times of emergency or scarcity, or in situations where carrying large amounts of food was impractical. Rations would often contain carefully balanced mixes of nutritional supplements designed to nourish the body in place of normal food. A common problem with such rations was that their taste left much to be desired.
Rationing in time of crisis or scarcity
Rationing food and water was a strategy employed in many cultures to deal with scarce supplies and shortages. If the situation grew worse, it might become necessary to cut the rations. Rationing was sometimes necessary on newly-colonized planets.
In 2372, when Lieutenant commander Tuvok was stranded on a Drayan moon with three apparent Drayan children, he offered Starfleet rations when Corin complained that he was hungry. When Corin asked for takka berries and Elani added "with cherel sauce," Tuvok replied "We have only rations." (VOY: "Innocence")
Field rations, combat rations and emergency rations
During away missions and many other types of deployments, rations were widely used to feed personnel, as it obviously not always possible to reach a mess or replicator for meals. While such rations were used for practical reasons rather than due to scarcity, often shuttles and isolated facilities would also contain emergency rations, which could keep a person alive until help arrived should they find themselves cut of from their support structure. This was standard practice in Starfleet and amongst many other cultures.
Klingons used ration packs during planetary excursions, and left a few empty ones on an unnamed planet. (ENT: "Observer Effect") Klingon food packs were a form of nutrition available aboard their Birds-of-Prey during the late 23rd century. While making repairs to the captured HMS Bounty, Montgomery Scott replaced the Klingon food packs with something more tolerable for their return to Earth, noting that the Klingon food packs were giving him "a sour stomach." (Star Trek IV: The Voyage Home) In the late 24th century, Jankom Pog, a Tellarite, once cooked Klingon rations his crew had found in a derelict Bird-of-Prey, opining that the food was "still better than eating mud." (PRO: "Terror Firma")
The Federation also made extensive use of rations, who went by many nicknames. Starfleet rations were specifically, "concentrated vitamin-enriched nutritional supplements." (VOY: "Innocence"). Although use of these rations were considered by many Starfleet officers to be a necessary evil, Julian Bashir developed a candy bar with superior nutritional value. (DS9: "The Siege")