If you are bringing a lot of prepackaged food with you on a hike you can save a lot of space and hassle by dealing with the packing before you set off.
Of of the easiest gains in space you can make is with meals that are cooked in the bag. They can be repackaged into zip-lock bags according to your portion size and instead of using a new bag for each meal, you can ditch all the trash and just bring one bag for cooking and eating. There is a huge amount of air in most of these meals and even the ones that come vacuum sealed usually get smaller when repacked specifically with size in mind.
Some items can also be easily packaged in more than one serving and divided up on the trail. This is a bonus when those food items already come in bulk like cereal, nuts, instant milk powder, couscous, pasta, and instance rice which are available from grocery stores and can save money while organizing your meals.
Regardless of what your putting in each bag, you need to label it so you know what is in it, the directions for cooking it, and when you are planning on eating it. If you are having trouble writing on the bag, slip a piece of paper in the bag.
Think about when you are planning on eating you food because if you do it too soon your food will spoil. If you are doing a resupply it is best to mail food in its original container and repackage on site. If you are organizing your own food without proper packing a vacuum sealer is good for shipping out your food and keeping it fresh, but before you hit the trail it is better to have your food in reusable bags which you can use to hold trash and seal up after you have eaten the contents.
Another good tip is to group foods by type and put those in larger freezer bags. Although this will create extra weight and trash to deal with, dealing with a bunch of smaller bags on a long trip will case increased handling and increase the chances of a problem with something breaking or getting misplaced. By having them sorted by food type you can tweak your meal plan on a whim to meet your appetite and know that just just swapping a dinner of one night for another and the calories should be about the same.