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.
For the rest of the story: http://mentalfloss.com/article/50818/what-causes-late-night-snack-cravings