Chaz just about covers it.

I would add a couple of things. First, hydration. Drinking too much pure water can cause an electrolyte imbalance - what someone called water intoxication (not the fun kind). Crystal Light and other hydration additives will protect you from that. Or you can make your own. I use a packet of unsweetened lemon KoolAid, a teaspoon of table salt (sodium chloride) and 1/4 teaspoon of salt substitute (potassium chloride) per quart of water - but only in 1 of 3 quarts - well maybe every other quart in hot weather. I go by the feel. In hot weather and desert hiking, I will easily slam 6 quarts per day.

Second, sustained energy from complex carbohydrates. Complex carbs will carry you further than simple sugars. Simple sugar will give you a momentary boost and can aid recovery, but it does not last and the come-down can be brutal if you are racking miles.