One reason this works better with religion is that membership of a religion means being subjected to the same prescribed morality. It means a lot more uniformity, which makes it easier to connect. After all, there is less chance you'll hit upon a subject you massively disagree on.
While that is no doubt true, I feel like that is only part of the story. Many (most?) religions teach to love all people, even if you don’t agree with them. It’s easy to get along with those who agree with you. It’s much harder to get along with those who don’t.
The Bible tells us to love our neighbors, and also to love our enemies; probably because generally they are the same people. - GKC