poetic justice

/pəʊˌɛtɪk ˈd͡ʒʌstɪs/noun
Graduate
1

Synonym of poetical justice (“the idea that in a literary work such as a poem, virtue should be rewarded and vice punished”).

2

The fact of someone experiencing what they deserve for their actions, especially when this happens in an ironic manner.

Thesaurus