idiom
poetic justice
Meaning
a situation in which virtue is rewarded and vice is punished, often ironically
Example
It was **poetic justice** when the dishonest lawyer lost his case due to his own lies.