It’s not that dogs aren’t altruistic, but they know a good situation when they see one.