A debate has raged around whether humans help only for gain (the social exchange theory) or because we sincerely care about the other person’s well-being (the empathy-altruism hypothesis). The leading figureheads for each argument were Daniel Batson and Robert Cialdini, respectively.
A 1982 study showed that empathy could motivate purely-altruistic giving, but it seems to prove something more profound. By default, we help egoistically, but if we share characteristics with the subject, we help whether it relieves our distress or not.