Empathy is the foundation of much of the good in civilization, so it is odd that so few people know it's psychological nature.
I'll use a simple and obvious example to illustrate empathy: Suppose that a sociopath tortures an innocent animal. Suppose also that there is an onlooker, who reacts in some way, depending upon their character traits. The reaction of a fellow sociopathic onlooker would be to laugh, or to feel some other crude positive emotion, or at best, complete indifference. An onlooker who possesses empathy, in contrast, would attempt to stop the injustice.
So then what is the mechanism that causes such empathic intervention behavior? It is more complex than you may think. Empathy consists of three different components that work together: conscientiousness, humility, and objectivity.
Conscientiousness is the general capacity to be bothered by things, and consequently take action. The opposite of conscientiousness is sleaziness. Sleaziness causes both personal irresponsibility and social irresponsibility; it causes such behaviors as habitual criminality, habitual use of recreational drugs (either legal or illegal), generally unhealthy habits, and irresponsible use of one's money.
Humility causes one to have consideration for all other conscious beings, regardless of their extrinsic traits. The opposite of humility is dominant egotism, which causes one to seek to crush and suppress anything other than oneself and the things associated with oneself.
Objectivity causes one to clearly see the distinction between victim and victimizer, and thus have empathy for the victim. The opposite of objectivity is antagonistic aggression, aka 'sliminess'. Said slimy antagonistic aggression serves to mix and blur together the contrasting things in one's perception, including victim and victimizer, as well as the severity of the actions between them (thus trivializing it). Thus, in the aforementioned scenario, an antagonistic-aggressive individual does not see a sociopath torturing an innocent animal, but instead only sees the sociopath and the innocent animal 'not getting along'.