So "morals" (in a certain definition) arises from empathy, which is an essential mechanism of survival that evolved through time.
That's very much the way I see it. The survival/reproductive advantage derives from the ability to get inside another person's head. If you can do that, you can perform little thought experiments that enable you to predict how that person will react in a given situation (useful in planning military strategy, getting laid, negotiating agreements, etc). You can perform little thought experiments that enable you to predict how YOU will react in a given situation.
It's like running a simulation. The more realistic the simulation, the more accurate the predictions. This ability is so well developed in humans that we can experience strong emotional reactions to entirely imagined scenarios. Simply picturing ourselves in a dangerous (or merely uncomfortable -- or happy, or sad, or romantic...) situation is often enough to trigger measureable physiological responses indistinguishable (in quality at least) from those we would experience in the actual situation itself. When we watch another person facing some challenge -- even if it is merely a fictitious person portrayed in a book, film, or daydream -- we cannot help but put ourselves in that person's place; to feel what (we imagine that) that person would feel, etc. We
become the characters in those simulations.
Figuring out the locally accepted sets of rules for social interaction I see as a separate process. It's like learning the language. In fact, many of those rules may be embedded in the language itself; learn the language, and you get a lot of the rules at the same time. But nothing guarantees that the locally accepted rules will always be compatible with the intuitive, empathy-aquired insights into what is "right" and what is "wrong". As Hume said, those are not really
insights so much as they are
feelings. The "rules" may require that the individual ignore the feelings, but that's easier said than done. I simply cannot believe that there ever was a man capable of stoning his own daughter to death (for, say, worshipping "other gods") and walking away psychologicaly unscathed, free of the torment of knowing -- of
feeling, on a deep level -- that he had just committed a profoundly immoral act. There are those who might try to explain this in terms of kin altruism, but I see that as both unnecessary and insufficient. Could
any participant in such an event avoid imagining (every day for the rest of their lives, probably) what it must have been like for the victim? Unless they were somehow wired very much differently than most of us appear to be, I'll bet they'd just
wish they could.