Poetic justice is a literary device in which virtue is ultimately rewarded or vice punished, often in modern literature by an ironic twist of fate intimately related to the character's own conduct.
Poetic justice is referred to in "The Simpsons" episode "Boy Scoutz N the Hood." When Bart returns home from a Junior Campers meeting Homer asks "How was jerk practice boy? Did they teach you how to sing to trees and build crappy furniture out of useless wooden logs?" The chair that Homer is sitting on then breaks and he declares "D'oh! Stupid poetic justice."