means that
someone responds to another person's treatment in kind, often by retaliating for a wrong or insult.
When to treat someone in the same manner they treated you, often in the sense of revenge or retaliation., the saying “To pay one back in one’s own coin” is appropriate.