It seems that cooperative altruism and out-group violence are both innate to some extent. Ecology and society determine how we realize those traits - in times of intense competition, we resort to tribal warfare. In times of plenty, we cooperate.
It should also be noted that Chimps and Humans are among the few species (perhaps the only mammal species?) that exhibit this tendency to wipe out their competition with systematic violence. IOW it's not just competition for resources in the moment - all animals do that. It's the sustained desire to wipe out the competition completely (effectively, genocide) that make both Human and Chimp violence rather unique in the animal kingdom.