As one experiences compassion, one comes to value compassion; or with gratitude, one comes to admire being gracious, and consider gratitude a virtue.
This passage suggests that the experience of compassion or gratitude can lead to an increased appreciation for those qualities, making them seem more valuable and desirable.