What is it that makes a "midnight snack" so irresistible? Short answer: blame your ancestors.
A recent study published by the journal Obesity found that late night snack cravings are the work of the body's circadian system, which acts as an internal clock to control when the body performs certain habitual tasks. It's the circadian system that increases cravings for sweet, starchy, or salty foods in the evenings. This urge is a remnant of a now-defunct survival mechanism in which eating large meals at night would help our ancestors store energy in times of famine.
Much like the human appendix, evolution and changes in human eating habits have rendered it obsolete; however, unlike the mostly harmless appendix, this former survival tactic is now a huge contributor to morbid obesity. Snacking at night is counterproductive for the body, because sleeping doesn't expend the same energy—and calories— as one's daily activities do.
Steven Shea, Ph.D., one of the researchers who conducted the study, concluded that the circadian system causes a nighttime peak in appetite that promotes larger, more caloric meals before the fasting period of sleep. Shea said that "because of the internal circadian regulation of appetite, we have a natural tendency to skip breakfast in favor of larger meals in the evening. This pattern of food intake across the day is exactly what Sumo wrestlers do to gain weight … So, it seems likely that the internal circadian system helps with efficient food storage. While this may have been valuable throughout evolution, nowadays it is likely to contribute to the national epidemic of obesity."