As others have said, set over set on a dry board (no flush or straight possible yet) is just a cooler, and everyone loses a big pot in that situation. But it is a common mistake for people to overvalue small pairs and play them to often, especially from early or mid position. If you play 22, you are always going to be on the bad end, when set over set happen, but if you play 77, you are at least sometimes going to be on the good end as well.
Setmining is often not as profitable, as people think, and one of the reasons for that is actually, that if the pot gets really big, assuming deep stacks like in a cash game or early in a tournament, then a small set is often not the best hand. So while everyone loves to talk about the fantastic implied odds they get from calling with 22, the truth is, that there is a fair amount of reverse implied odds as well.
And there are also situations, where we should not fold a small set, but we cant raise and play for stacks either. Lets say a tight opponent open UTG in a 9-handed game, and we are 100BB deep. We call on BTN with 33 and flop comes KT3 rainbow. If we start raising here and jam the river, what is a tight player calling us down with, that we beat? He dont open KT from UTG, or at most KTs, which is only 2 combos. He is probably also not stacking off AA or AK as just a single pair. So the answer is, if we fire really hard at this, we might only get called down, when he has exactly KK or TT. And therefore our best play is actually to just call him down to keep those one pair hands in his range, that we beat.