It means to remind someone that they are jnferior or about how less fortunate they are. For instance,
Mark: Ugh. I can't believe I have to work tomorrow.
Steve: Yeah, that sucks.
Mark: Yeah, I really wanted to go to the beach with everyone.
Steve: Well, I don't have to work tomorrow. Don't worry though. I'll enjoy the waves and a few cocktails for you. Hahahaha
Mark: Thanks, Steve. Rub it in, won't ya? / Don't rub it in. / No.need to rub it in.
By the way, "to rub it in" = "to rub it in someone's face". It comes from the analogy of rubbing a dog's face in their crap to potty train them. Anyhow, you could also say, "No need to rub it in my face."
In another context, it could mean to apply something like suntan lotion on the skin evenly so it isn't visible. For instance:
Stacy: Could you put some sunblock on my shoulders?
Mark: Sure.
*Mark squeezes some sunblock on her shoulders*
Stacy: Oh there is Dan. No need to rub it in. He will finish it for me.
Mark: Oh, okay. No problem.