From several scenes in Hamlet, we know that the political situation is tenuous and delicate between the two countries. In Act I scene i, we learn that Hamlet's homeland is under threat from Denmark because young Fortinbras seeks to regain lands lost to Hamlet's father by Fortinbras' father years before.
The appearance of the elder Hamlet's ghost seems to fortell of the upcoming war since ghosts are considered to be omens to such things. The ghost is also dressed in armor, which makes the sentries wary of the future.
In Act I scene ii, Claudius informs the court of the aggression from Norway and sends messengers to the King of Norway (the uncle of young Fortinbras) to curb the boy's zeal.
Later, in Act IV sc iv, young Fortinbras, discouraged from attacking Denmark, now has his sights on Poland. Hamlet remarks on his on inability to act while young Fortinbras and the Polish are willing to actively fight and die in the name of honor.
Finally, in Act V sc ii, young Fortinbras enters and realizes with sorrow that he now has the opportunity to assume the Danish throne. Horatio comments that Hamlet spoke in favor of Fortinbras' rule. Fortinbras orders Hamlet’s body carried “like a soldier” to the stage, and says if Hamlet had had the chance, he would “have proved most royal.” As the new King of Denmark, he orders appropriate funeral rites for Hamlet, including the firing of ordnance, which marks the ending of the play.