Yes, any social animal has to have evolved to be social -- each individual's survival depends in part on the survival of the group. But, as you say, that doesn't stop competition within the species.
Real "altruism" on the other hand, seems to be a uniquely human trait & I don't think that evolution can account for it.