Through the ages, humanity evolved to recognize that cooperation generally leads to success. If others like us, we have more of a chance to survive and procreate. So our brains release chemicals that make us feel good when we do things that lead us to success. It used to be that sugar was pretty tough to get, so our brains evolved to release those nice chemicals when we eat it. So too is it that when we receive validation, the brain releases those chemicals then as well.
Not everyone is consciously aware of this happening. They just know that when they do some things, act a certain way with a certain group of people, eat certain foods, etc. they feel good. They don't know that they may be painting themselves into a corner, so to speak, where the only way they can feel good is by doing the things that give them the most of those chemicals. That's why drugs can be so incredibly dangerous, but it's also why you see people doing things that don't make a lot of sense outside of their particular clique. We bounce back and forth between the things we enjoy and needing that enjoyment of those things to be validated.