I would add one thing, though... in the days before social media, but also before near-instant transportation and tv and stuff, people lived in geographically isolated communities. While there wasn't cultural self-selection, your culture was selected for you, and almost everyone you knew was like you.
This is reflected in politics as well. Urban areas are necessarily more socially diverse than rural areas. If you live in a big city, you rub elbows with people different from you every day. You learn to be tolerant and respectful of social diversity just for your own sanity. Homogeneous rural communities don't learn tolerance, because they don't need it, and it's arguably a hindrance. So we wind up with socially tolerant, diverse liberals, and socially intolerant, monoculture conservatives (not passing a judgment here). It's a result, not a cause.
Social media exacerbates both these tendencies... on one hand, it's so easy to build purist echo chambers, which lead to holier than thou political one-upmanship and drive extremist views. On the other hand, we're constantly exposed to people wildly different to us through friends-of-friends. That's a lot of cognitive dissonance. Rather than leading to more tolerance, it's leading to uglier forms of intolerance.