You might like reading Darwin's Catedral by David Sloan Wilson. It's a recent take on the old idea of group selection, a theory that attempts to explain the human drive to cooperate. In that telling, it would take some form of religion to coopt that drive and allow human groups to grow large and be nice to strangers. Or not nice when they're seen as out group. I find this explains a lot about us.