The sources of Hamlet
With some plays of Shakespeare it is illuminating to compare his version with the source, or sources, he used: in King Lear, for example, he completely reversed the ending, making a comedy of age rightly restored to power into an intense tragedy in which even the innocent Cordelia dies*.
But with Hamlet the immediate source is less accessible. There are versions of the story which go back to the twelfth century, but it is likely that Shakespeare used or rewrote an earlier play written in the 1580s, probably by Thomas Kyd, author of what was the most popular revenge play of the period, The Spanish Tragedy.
What difference does it make to our understanding of the play if we see it as belonging to a long tradition of plays on revenge?
Footnotes
-
All's well that ends well
It is really not so surprising that in the Restoration the play was rewritten by Nahum Tate in order to restore the happy ending. So distinguished a critic and editor of Shakespeare's plays as Samuel Johnston continued to prefer Tate's version.