I think there are two kinds of slagging off:
a) ill-natured gossip about things that are nothing to do with you
b) letting off steam about something that does concern you and is hurting you but where causing a fuss straight to the person's face would cause a major upheaval and possibly end up hurting a third party
c) and related to the second: ranting about something which is upsetting you at the time but where you need to check out another person's reactions before you decide if it is big enough to risk above possible upheaval
a) is obviously not very nice, but you can see some justification for b) and c).
If for instance you know that your dc have a close and loving relationship with your MIL which you want to preserve for both their sakes, and because you love your dh, but same MIL is always making little barbed remarks which you know she could pass off if challenged (making you look like the stirrer), but which you also know are intended to undermine you, then being able to rant somewhere safe can act as a safety valve. Telling MIL straight to her face may result in MIL going NC at a time when she may be getting frail and in need of her son's help and you don't want to do that to any of them.
disclaimer: this is not about my MIL, who is officially the world's loveliest person; it's about another family situation.
Another example: I was out last week with a colleague in my field (but not involved with my workplace). Some of the things said in relation to my next project were seriously upsetting to my confidence, but it was very difficult to pick up on it at the time, because:
a) it was difficult to know if the remarks were intended to be as patronising as they sounded; I needed to check with another person who was there and heard it
b) this was a social occasion and I did not want to upset other people present
c) acting offended or hurt would further reinforce the impression that I am a sweet little thing who does this as a hobby but who can't play "with the big boys"
d) I am actually very fond of this person and did not want to cause upset to him either
Otoh they really hurt me in an area where I am insecure, because I have had to work harder than other people to become established and, despite my age, am not quite there yet. I needed a long rant to remind myself that actually I do believe in this, colleague in question may be more established than I am, but I am the one that knows where this project is going. I needed to hear someone say "yes, of course you should believe in this idea and push on with it"- otherwise, it would have been incredibly difficult to go in and write something good the next day.