IOW, we do it because of what we get out of it, not because they deserve it.
At it's base, yes, but it can go further than that.
We are all humans and we hurt each other, we do it by actions and by words.
Obviously some people hurt others far more, but if we want to be forgiven for the many times we hurt others, it is only right to forgive those that hurt us and in doing so we accept that we are imperfect and that we need to do better and be better.
Forgiveness is leading by example and is a sign of love and nothing breaks the circle of hate and violence other than love.
Now, forgiveness doesn't mean allowing a person to harm us over and over, no of course not.
It means that we forgive another for what they have done, that hate is replaced by love ( not for the other person per say becuase that may not be possible, but love fo ourselves and so that we don't punish ourselves anymore) and that we grow beyond that damage that has been done.
It is NOT selfish, though it can be, it is also NOT unselfish.
Forgiveness is for US, for THEM and for ALL.