We do this mechanically by first freezing the food so any liquid it has will form into solid ice crystals. Next, the pressure is decreased while the temperature is increased just slightly. This forces a process called sublimation, which means that the water will convert directly from ice into vapor without passing through its liquid phase. Fancy!
What's left behind is a very dry shell of the original food. If you looked at it under a microscope, you'd see a honeycomb structure left behind by the evaporating water. Tightly-sealed in an absolutely air-tight container, freeze-dried food will last for years. All it takes is a little water to make it edible again.
Freeze-drying has actually been around a lot longer than you might think. According to Harold McGee in On Food and Cooking, freeze-drying was first used by the native people of the Andes. A combination of dry sunny days, freezing nights, and high altitude meant that meat left out to cure would dehydrate while leaving the basic structure of the meat intact (unlike making jerky).
Incidentally, freeze-drying is different from dehydrating because dehydrating changes the food's original structure, affecting flavor and texture. Jerky and dried fruit can never look or taste like the original food again. Then again, astronauts and soldiers with Meal-Ready-to-Eat rations might argue that freeze-dried foods also taste nothing like the real stuff...
What's been your experience with freeze-dried foods?