Morality is a social behavior seen in mammals and some birds that depends on an interlocking brain organization shaped by four factors: (1) caring (rooted in attachment to kin and kith, and the pain of isolation), (2) recognition of others’ psychological states (goals, feelings, needs); anticipating events painful to me-and-mine is more efficient when brains can represent others as having sensations and intentions, regardless of assorted contingencies in behavior and background conditions, (3) learning social practices and the ways of individuals in the group that emerges from reward system-cortex interactions (4) problem-solving in a social context (figuring out what modifications to a social practices serve stability and prosperity). Between species, the importance of these factors can vary, as a function of natural selection operating on subcortical structures, and of the degree of flexibility of the cortical organization. Increased capacity for impulse control is a feature of frontal brain expansion. Social benefits are accompanied by socials demands; we have to get along, but not put up with too much. Hence impulse control -- being aggressive or compassionate or indulgent at the right time -- is hugely advantageous. In different contexts and cultures, expression of sociality may vary, as local factors limit solutions to the social problems of getting along and prospering despite competition between individuals.