In Act 4, Scenes 1-3, death is the focus--first that of Polonius, and later, the plans Claudius has hatched to see Hamlet executed when he reaches England.
At the beginning of this act, Hamlet has again adopted his "antic disposition." Hamlet has grown to be somewhat more savvy regarding the intrigue of Claudius's court. He has already admitted to Gertrude that he expects "knavery" from Rosencrantz and Guildenstern when they all travel to England, but Hamlet has plans of his own. By continuing to act mad, along with Gertrude's insistence that he is indeed insane, he can keep his enemies from knowing his plans.
In the guise of a madman, Hamlet plays games with Rosencrantz and Guildenstern with regard to where Polonius's body is. Hamlet has fun at their expense, and even insults them.
In Scene 3, Hamlet finally comes before the king. Claudius is attempting to find out where Polonius's body is hidden. Hamlet engages the King in word play. Here, again, he acts as if he is mad. For example, he speaks in riddles about worms, a fish, and a king:
A man may fish with the worm that hath eat of a (30)
king, and eat of the fish that hath fed of that worm.
When Claudius asks what this statement means, Hamlet allows that in death all men are equal from the perspective of a worm, saying:
Nothing but to show you how a king may go a
progress through the guts of a beggar.
Getting to the point, Claudius asks where Polonius's body is. Claudius is a cold-blooded killer. Hamlet is not. And while he may act mad to throw Claudius off-balance, the man is shrewd. While Hamlet may expect attempts on his life, he cannot always know what specifically to expect. Hamlet has given Claudius reason to believe that he is dangerous, and this does not bode well in terms of the lengths to which Claudius will go to rid himself of Hamlet. Death in this scene is always close at hand.