From the first scene of Hamlet, Shakespeare presents Denmark in a state of chaos. In the first scene itself, he does this in two ways, first by showing how nervous and alarmed the watchmen are as the play opens, then by having Marcellus inquire about and Horatio explain the reasons for all this anxiety.
The first words of the play, "Who's there?" are spoken by Bernardo. Instead of answering the question, Francisco demands to know who is asking. Kenneth Branagh's film of Hamlet makes the sheer terror of both men particularly obvious, but it would be an unusual director or reader who did not remark upon the tense atmosphere of the play's opening. We might assume that the ghost is to blame for this. However, Horatio explains that an invasion by young Fortinbras of Norway is their primary concern.
Fortinbras does not make many appearances in the play, but whenever he does, it is to disturb both the order of the state and Hamlet's peace of mind, emphasizing the disorder into which Denmark has been plunged, even as he exacerbates it. This is true of every appearance except his last, when he restores order by taking over the troubled kingdom, in accordance with Hamlet's dying wish. Such a role is entirely in accordance with the pattern of Renaissance tragedy, in which disorder and pollution are driven out of the state by a strong leader taking control.
The metaphor of the weed-filled garden in Act 1 Scene II strongly conveys chaos and disorder in the plot:
Tis an unweeded garden
That grows to seed. Things rank and gross in nature
Possess it merely. That it should come to this.
But two months dead—nay, not so much, not two.
So excellent a king, that was to this
Hyperion to a satyr.
The garden that is being choked and overgrown by weeds is a representation of Denmark, which has become corrupt under the rulership of King Claudius. Corruption is a spreading influence that destroys the stability of the kingdom, just as weeds grow to consume the beneficial parts of a garden. "Things that are rank and gross in nature" represent the malignant and evil nature of people who would thrive under Claudius’s rule.
Shakespeare reinforces this metaphor by pairing it with an analogy. ‘Hyperion to a satyr’ is a comparison between Hamlet’s father, who was the previous ruler, and King Claudius. Hyperion is the Greek Titan god of light, emphasizing the benevolence and godlike nature of King Hamlet. By contrast, satyrs are drunken, lust-filled lesser gods, often represented as a man with a horse’s ears and tail. Claudius married his brother’s wife, and Hamlet expresses disgust for his uncle’s drinking habits. Hamlet’s words reflect his belief that Claudius is a bestial man, emphasizing this point using elements of both nature and mythology.
As mentioned previously, Hamlet is a warning to Elizabethan society toward the end of the aging Elizabeth I's reign, whose unmarried and childless state presented the dire issue of who would succeed to the throne. Moreover, there were multiple assassination attempts during Elizabeth I's reign, such as the Ridolfi plot in 1571, the Throckmorton plot in 1583, and the Babington Plot of 1586. In recognition of this ongoing state of political chaos in Shakespeare's time, the plot of Hamlet does not seem farfetched.
In writing the play Shakespeare wanted to warn his fellow countrymen of the dangers of political instability and the disorder to which it could lead. At the time that Hamlet was written Queen Elizabeth I was coming to the end of her long, illustrious reign, and thoughts inevitably turned to the question of the succession. Shakespeare was as anxious as anyone to ensure that the handover of power would be a smooth and peaceful one.
Denmark under Claudius is used by Shakespeare as an example of what can happen when a change of ruler is violent and bloody. Claudius has become king of Denmark due to murdering his brother, Hamlet's father. As a result, Denmark has become mired in moral corruption so bad that it seems to poison the very air that Hamlet breathes. Hamlet's tortured soul is a reflection of the chaos that has now descended upon the kingdom. He himself cannot bring order to his soul any more than to Denmark. It's notable that only a foreign invader—Fortinbras—can do that. Once again, Shakespeare is giving his audience a stark warning: if we cannot maintain good order in our own country, then someone else, probably a foreign king, most certainly will. And that would be a tragedy indeed.
Chaos and disorder occur from the very beginning of the play. Denmark has lost its king and Fortinbras of Norway is threatening to invade. Horatio remarks on this as he watches for the ghost in Act I and Claudius sends an envoy to the king of Norway asking him to stop his nephew from invading. Disorder also occurs in the ruling family. Hamlet discovers that his father, the late king of Denmark, was murdered by his uncle and spends the entire play either researching the truth or plotting revenge. The house of Claudius is never put into order because of the threats from both Hamlet and Fortinbras. Hamlet is also acting as if he were insane, adding to the chaos that already exists in Claudius' administration. All of this comes to a climax at the end of the play when Fortinbras enters and finds all of the royal family dead. In their search for power and revenge, they have caused the disorder that eventually destroys them. Fortinbras is then able to restore order by taking control of Denmark.