It may be a no brainer--(pun intended)-but one of the seminal defenses agains the concept of religion required for morality is the observation that the more socially involved a primate is--the greater the size and complexity of their brains. Now even given that correllation and causality are independant sometimes--the fact that this is universally true indicates a real connection between the evolution of brain size and cultural sophistication.
Gelada baboons have an interesting behavioural complex. When a sub adult male wishes to join a troop it engages in grooming--both hysical--and what xzoologists are discribing as vocal grooming--a pattern of sounds that is soothing to other geladas. Unfortunately the territoriality of geladas means that at some point he will run afoul of the alpha male--a 100 pound fanged lion of a monkey. The solution is to pick up and groom the baby of a female that he has areadty gained the trust of. Gelada baboons will not harm infants in their troop. THey will also not risk harm by asssaulting anyone carrying an infant.
New footage of chacma baboons has revealed sophisticated flamingo hunting behaviour developed in the very recent past.
Gorilla's also have this prohibition against harming infants-to the point that individuals behaving as an infant or being protected by a female gorilla will not trigger threat displays form males.
The point is--that the presence of this "morality"-rules for the protection of infants and as suich, the protection of the troop--are selected for.
This seems to be a reciprocal loop with greater in group protetive empathy--leading to larger more complex brains--which cycles toward reinforcing more social organization.