Jonathan Haidt said this quote

Morality often involves tension within the group motivated by competition between different groups.