A couple of thousand years ago, Aristotle wrote a pamphlet on playwriting called “Poetics.”
It comes down to a few simple rules. It’s the hero journey from A to B with the hero being transformed - from a beggar to a king, from a king to a beggar.
It has to have the least number of possible steps. It has to happen in one place, over 48 hours.
In the end the hero has to undergo recognition and reversal of the situation.
In a tragedy the hero has to recognize his own undoing by his own hand.
As the audience we share his recognition with shock and awe.
We feel his fear and offer our pity.
We are cleansed.