“The experiment involved a give and take system, where robots could choose which of their peers to donate to.
As the virtual game unfolded, individual robots learned new donation strategies by copying other robots to benefit themselves.
The study found that robots would donate to each other within small groups, denying outsiders to improve their own takings.”
So the scientists made the robots play a game and the robots found a winning strategy. This is simple game theory, it has nothing to do with racism or sexism.
But it explains why nationalism and tribalism is basically human rent seeking behavior and cannot be effectively removed by propaganda or legislation.