Because as St. Thomas uses the term "defectus," it means anything that is lacking that shouldn't be lacking. He would say, for example, that not having enough food is a defect in the person who doesn't have enough food. To be miserable necessarily involves having a defect. (And before we laugh and point too much at his ridiculously unnatural philosophical language, we might ask ourselves if we've ever wondered what's "wrong" with someone who looks sad.)
In any case, St. Thomas says that, in order for us to take pity on someone, we must make their defect, their cause of misery, our own; and, further, that we have only two reasons for doing this:
Due to union of the affections: We are so united through love with the person that we necessarily regard their defects as our own.
Due to real union: We are aware of the possibility that we too might suffer in the same way.
The latter reason, he says, is common among both "the old and the wise" -- who know better than to pretend they're beyond the reach of evils that befall others -- and among "feeble and timorous persons," whose find it easy to imagine themselves suffering.
Whichever reason (or combination of both) we have for being merciful, it involves a defect, a cause of misery, within ourselves. It's a conclusion that has some significant implications -- and they aren't merely of academic interest, at least not for people who want to follow both commands of Jesus quoted above.