The story
From poetic + justice, a variant of poetical justice, coined by the English literary critic Thomas Rymer (c. 1643 – 1713) in the work The Tragedies of the Last Age Consider’d and Examin’d (1678): see the quotation.
Etymology from Wiktionary, CC BY-SA 4.0.