When you treat someone badly, similar to how they’ve previously treated you, that means you’ve given them a taste of their own medicine. When you are treated the same way you treat others, you get a taste of your own medicine. You might think of it like karma, that the bad deeds you committed come back on you. This idiom is always associated with something negative, and it can be used in social or professional situations.
He’s always been so stubborn. Now, he’s getting a taste of his own medicine with his new girlfriend.
The company likes to play hardball with negotiations. Let's give them a taste of their own medicine.