Why does a person care more if a friend, relative or neighbour goes through good or bad times, as opposed to an unknown person in Mozambique?

In theory according to some we should care about everyone in the world equally but in practice we react more to those we know and love.