From Scientific American:
The system in the brain that both drugs and food activate is basically the circuitry that evolved to reward behaviors that are essential for our survival. One of the reasons why humans are attracted to food is because of its rewarding, pleasurable properties. When we experience pleasure, our brains learn to associate the pleasurable experience with the cues and conditions that predict it. In other words, the brain remembers not just what the food tasted like but also the sensation of pleasure itself, and the cues or behaviors that preceded it. That memory becomes stronger and stronger as the cycle of predicting, seeking and obtaining pleasure becomes more reliable. When you remember that food, you also automatically expect the pleasure that comes from it. So when you like something very much, the mere fact of being re-exposed to it, even if it is out of reach, will trigger the desire to get it. In scientific terms, we call this process conditioning.
More here.