Us Versus Them
It's a well established principle of evolution that members of a species don't just compete against other species but, more importantly, against other members of the same species. At some point, humans managed to transfer much of this competition from individual versus individual to group against group. It's not a peculiarly human invention - Chimpanzees do the same thing. Male Chimps are stuck in the band they were born in. Transfer to the neighboring band is not an option.
Transferring competition from the individual level to the group level requires some kinds of walls to be drawn around the group. In our own culture we see echoes of that in style, uniforms, "colors" and gang signs. In a more primordial setting there are all the marks of culture that distinguish one society from another: language, territory, dress, adornment, family organization and so on.
Human cultures appear to be much more different from each other than purely accidental choices would seem to predict. I think that this is due to the fact that these cultural traits are designed to be walls - walls that keep some in and others out. Endogamy rules are one of the starker realizations of this idea.
About three thousand years ago, says Prof. Harari, a radical development appeared in human culture - the notion of a universal "us." Many factors of technology and culture acted to propagate this new notion, but he gives priority to three: money, empire, and universal religions. I don't think it would be a mistake to add trade and communication, though all these factors are interrelated. Together they act to destroy old cultures and fashion a new one.
Of course walls are hardly useful unless they have some structural strength, so cultural resistance to disintegration can be fierce. The result is a global meta-culture, a sort of mixture of of partially dissolved cultures of all sorts, each trying to preserves some of its identity in an aggressively dissociative universal acid.
Some of my correspondents claim that the physical manifestations of cultural identity are a lot less important than certain differences of attitude and mental state. I have asked for (but haven't received) short lists of unshared attitudes and mental states, but even granting that there are such, it's hard for me to accept that these, so variable among individuals and even in the same individual, trump the concrete realizations of individuals attitudes. The work one does, the kinds of clothes one wears, the foods one eats, the way one chooses ones mate all reflect very fundamental aspects of our attitudes and identities.