It is learning by doing for children. I think basics like having respect for others, being polite etc, these things are the things that our children learn by observing our behaviour, and by copying them.
Of course we have to, at some point, sit down and explain things to them. Explain that calling someone a cow is unacceptable and that hurts their feelings, for example. And that stealing is wrong. But I do not think that they learn this at 2yo, probably closer to 4yo.
And saying sorry is just an extension of that. I stopped making DS say sorry for anything he had done wrong and just told him that I was not happy with his behaviour. Now, at 3.5yo he apologises if he does something wrong, and I feel that he is sorry.