As a literary term, nemesis most precisely means:
Read the explanationHide the explanation
In criticism nemesis is deserved retribution, especially the downfall that answers pride or crime, and by extension the person or event through which it comes. A villain is not necessarily an agent of justice; the tragic flaw (hamartia) is the cause, not the consequence; the opening speech is a prologue.