Hamlet was written during a time of political uncertainty and fear, which has parallels in both the mood and the events of the play. The play was probably first performed in 1602, when Queen Elizabeth I was sixty-eight. She had no children, and it was unclear who would inherit her crown when she died. Elizabeth could have put an end to the uncertainty by naming an heir, but she refused to do so, which contributed to a widespread belief that the once-popular queen had become irresponsible in her old age. In Hamlet’s Denmark, just as in England, the royal succession is uncertain. Claudius has hastily married the queen in order to secure his claim, and the old king’s son, Hamlet, is openly unhappy about it. The new king spends all his time drinking, and there are rumors that a foreign invader plans to take advantage of the kingdom’s weakness. Hamlet captures the contemporary fear that irresponsible rulers and an uncertain succession were destroying the country.
Shakespeare’s contemporaries believed that the health of a kingdom depended upon the well-being of its royal family: in Denmark as in Shakespeare’s England, the royal family is in decline, and the effects are felt in the kingdom as a whole. In Shakespeare’s England, the ruler of the country was also the literal embodiment of the country itself. Elizabeth I wasn’t just the Queen of England: she was England. The queen was aging and sick and she had no children to inherit the kingdom. Her family would end with her, and Shakespeare’s contemporaries felt that a period of prosperity in English history would end with it. A similar mood prevails in Hamlet’s Denmark. The heir apparent, Hamlet, wishes to kill both Claudius and himself, which would leave Denmark without an heir. Hamlet shows no interest in having children himself: he asks Ophelia ‘Why wouldst thou be a breeder of sinners?’ (III;i). The Queen, Gertrude, like Elizabeth, is too old now to bear children. The royal family of Denmark is no longer healthy, and so neither is the kingdom: “Something is rotten in the state of Denmark” (I.iv.).
Elizabeth I’s refusal to name an heir created opportunities for ambitious young noblemen: a further cause of political anxiety in Shakespeare’s England at the time Hamlet was written was the chaos and bloodshed these ambitions could cause. Although James VI of Scotland was a close relative of Elizabeth’s, as a Scot he was a foreigner, and under English law foreigners could not inherit English land: there were rumors that he planned to invade and take the kingdom by force. In 1601 the young Earl of Essex, a favourite of Elizabeth’s, led an attempted rebellion and Elizabeth was forced to execute him. In Hamlet, just as in Shakespeare’s England, there are rumors of a foreign prince, Fortinbras, preparing to invade the kingdom, and a young courtier, Laertes, leads a rebellion. Hamlet also has—or claims to have—political ambitions. Hamlet plays upon its audience’s fear of ambitious young noblemen and the danger they posed to ordinary people when there was not a clear line of inheritance of the throne.