"Othering" is itself an evolutionary development. Innate human altruism is deeply parochial, which comes out in many experiments, but especially those with young children. And it makes perfect sense when you think about it from the "selfish gene" perspective. We also know from observation that genocidal wars are something that other apes practice occasionally, so "othering" within species is likely something that predates our speciation as humans.