For backpacking, it can actually be important to have a high fat content: More calories in a given pack weight/space, lower amount of human waste generated, and typically less packaging needed to prevent spoilage.
I've read that traditional-recipe pemmican is the best trail food. Equal parts dehydrated, lean meat, and rendered fat, thoroughly blended. No fruit etc. in the mix, or its shelf life goes down from years (reportedly decades, if grass fed) to weeks.
I've also heard good things about
moose goo.
I like a trail mix made mostly of nuts, with chocolate chips, dry sweetened cranberries, and flake coconut helping to round out the flavor and nutritional profile.
Alegrias are excellent in many respects, if a little bulky: 7 parts popped amaranth seeds to 1 part honey, mixed thoroughly and pressed into bars. Press a few peanuts, raisins, etc. into the top if desired.
Traditional sourdough bread has a good shelf life; making a loaf with things like olives and sunflower seeds blended in might help boost the calorie content. California miners used to keep a pouch of sourdough starter tucked away in their clothing (hence the football mascot, "Sourdough Sam"), which seems like a sensible practice. A large batch of pancakes each day could provide two or three meals.
Seeds for sprouting might be a good thing to take along, especially for very long trips. They can manufacture nutrients, especially vitamin C, that do not keep well.
"the qualities of these bacteria, like the heat of the sun, electricity, or the qualities of metals, are part of the storehouse of knowledge of all men. They are manifestations of the laws of nature, free to all men and reserved exclusively to none." SCOTUS, Funk Bros. Seed Co. v. Kale Inoculant Co.