The limbic system is the system of structures in the brain that manage the chemicals that make us feel happy: dopamine, endorphin, oxytocin, and seratonin. The limbic system evolved throughout our evolutionary history and serves to reinforce survival behaviors by releasing chemicals that make us feel good when we do something that increases our chances of survival.
This survival instinct interacts with our experiences (especially those from when we are young) and exist as neural pathways in our brain. A great example of this is comfort foods which are typically both high in calories (survival advantage) and associated with positive family experiences.
Here is a breakdown of how the individual "happy chemicals" of the limbic system work:
Endorphin triggered by pain. Masks pain and provides a beneficial "runners high" for physical exercise.
Dopamine floods our system when we find a reward that we have been anticipating. When you find a hidden pack of candy leftover from easter and eat it, that's dopamine.
Oxytocin and Seratonin come from positive and rewarding social relationships. Conversely, the brains inability to produce and absorb these chemicals can lead to a lack of interest in social relationships.
An important thing to remember is something called the "hedonistic treadmill" or habituation. This is where the brain normalizes pleasurable experiences and fails to produce happy chemicals without elevating the experience. In other words repeating an experience will not produce the same positive experience indefinitely. The negative in this is that it can lead to risky pleasure seeking behaviors, but the positive is that it keeps us trying new experiences.
So are we a slave to our unconscious evolutionary programming? Fortunately, no, because another structure in out brain, the pre-frontal cortex, allows us to anticipate the long term consequences of our actions make conscious decisions about our behaviors. Often this feels like a tug of war as you stand with the refrigerator door open (dopamine) or struggle with whether to sling that stinging comeback at a friend of family member (seratonin). Researchers have found that it takes about 45 days to reprogram out brain for pleasurable experiences. This means that if you stick with a new habit you will eventually begin to experience a release of happy chemicals when you habituate yourself to a healthier habit.