Criticizing others is a way of building trust. In a three-way friendship with X, Y, and Z, if X establishes that he and Y can together criticize Z, that may boost trust between Y and X, and also increase X’s relative power in the group. Criticizing “Charles Manson” doesn’t do this — you’ve got to take some chances with your targets.
If you criticize X to Y, Y wonders whether you criticize him to others as well. This problem can increase to the extent your criticism is biting and on the mark.
“Complain less” is one of the very best pieces of wisdom. That is positively correlated with criticizing other people less, though it is not identical either.