At this point, we don’t know exactly why meditation is increasing compassion. My suspicion is that it’s one of two mechanisms.
The first has to do with its ability to increase attention. The world is full of distracting stimuli—the game on your iPhone, the replay of a date last night running through your head, and the like—that often prevent us from truly recognizing what’s going on around us. Meditation has been shown to enhance attentional processes, and so it might just be that the people who had been meditating were more likely to notice that the other person was in pain.
Another possibility, and the one that I favor, is that one goal of meditation is to break down categories. It’s meant to help individuals realize that everyone is linked and similar in some ways. Other work in our lab has shown that any subtle links of similarity between people increase the compassion that they’ll feel for each other, even if the level of objective suffering is the same (you can see a short talk I gave at the PopTech conference on the links between religion and science with respect to compassion). So, it might be this aspect of meditation that is playing a role as well.