Why do we crave attention and validation on social media?

I've been thinking about why we feel the need for attention and validation, especially on social media. Why does the human brain crave this kind of recognition? Humans lived without social media for thousands of years, yet now it feels like things are less meaningful if we don't share them online.

Why do we feel the urge to show that we're happy or living interesting lives? Sometimes it feels like traveling, eating, or just experiencing things isn't complete without taking photos and posting them. Has anyone else felt this way, and why do you think it's become such a big part of our lives?