CNN has a story about an experiment that suggests that 6- to 10-month-old infants have at least some innate social skills:

The infants watched a googly eyed wooden toy trying to climb roller-coaster hills and then another googly eyed toy come by and either help it over the mountain or push it backward. They then were presented with the toys to see which they would play with.

Nearly every baby picked the helpful toy over the bad one.

The babies also chose neutral toys — ones that didn’t help or hinder — over the naughty ones. And the babies chose the helping toys over the neutral ones.

Obviously, this needs to be confirmed by other researchers, and one shouldn’t place too much trust in the result of one experiment, but it’s still interesting: it suggests that babies have an innate sense of “this person is friendly” and “that person is unfriendly”, based on observation of people’s behavior.

Now, this does not mean that babies or young children have any idea of “I should be friendly”, nor does it suggest that these babies can judge whether they themselves are being friendly.

The article does mention, though, that

A study last year out of Germany showed that babies as young as 18 months old overwhelmingly helped out when they could, such as by picking up toys that researchers dropped.

Note the 8-month difference between this study and the German one: presumably in that time, children learn that if they act in a friendly or helpful way, then others will be friendly in return.

So if confirmed, this should form a fairly solid basis for morality as an emergent phenomenon. We’re social creatures who want to be liked by those around us. This experiment suggests that we’re born with the ability to figure out whom to like (or at least can work it out at a very early age). We can also start modeling other people’s minds (in the sense of “if I do X, will it please that person?”) early on as well. In short, we have the capability to work out a set of behaviors that will allow us to get along, as well as the desire to do so.

Now, it’s true that we also want base self-gratification (e.g., “I want to play with that toy, so I’m going to take it away from you, and I don’t care whether it annoys you or not”). But wanting to get along with others plays a part as well. And of course children tend to believe what their parents tell them, and presumably the parents tend to teach children their own values, like playing nice with others.

So it’s a noisy and chaotic process, but over time, people can figure out what sorts of moral rules work and which ones don’t, and improve morality.

It’s sort of like Wikipedia, in which lots and lots of people making changes, some good and some bad, can nonetheless gradually improve.