How absolute the knave is! We must speak by the card, or equivocation will undo us. By the Lord, Horatio, these three years I have taken a note of it. The age is grown so picked that the toe of the peasant comes so near the heel of the courtier he galls his kibe.—How long hast thou been a grave-maker?

Shakespeare’s tragedies often include comic scenes and characters, and as with this example in Hamlet, they sometimes appear as comic relief immediately after a particularly heavy incident. One such example is Hamlet’s Act 5, Scene 1 encounter with the witty gravedigger, which occurs immediately after we (but not Hamlet) have learned about Ophelia’s drowning at the end of Act 4, Scene 7.

Hamlet, whose exile to England has been prevented by pirates, is walking in the graveyard with Horatio when they encounter a gravedigger. After an exchange in which the gravedigger cleverly twists the meaning of Hamlet’s words to make him seem foolish, an astonished but impressed Hamlet speaks these lines to Horatio. He basically says that they must be careful what they say to the gravedigger or he will make fools of them again. He then makes the comment (probably meant as a joke) that he’s noticed that peasants have become almost as clever as the wealthy. (The phrase “the peasant comes so near the heel of the courtier he galls his kibe” means that the peasant is nipping the heel of the nobleman.) Hamlet then asks him how long he’s been a gravedigger.

The comic relief continues with the gravedigger’s reply and the ensuing exchange with Hamlet discussed in the subsequent quote.

Gravedigger: Of all the days i' the year, I came to ’t that day that our last
King Hamlet overcame Fortinbras.
Hamlet: How long ago was that?
Gravedigger: Cannot you tell that? Every fool can tell that. It was the very day that young Hamlet was born, he that is mad and sent into England.
Hamlet: Ay, marry, why was he sent into England?
Gravedigger: Why, because he was mad. He shall recover his wits there, or, if he do not, it’s no great matter there.
Hamlet: Why?
Gravedigger: 'Twill not be seen in him there. There the men are as mad as he.

Unaware that he is talking to Prince Hamlet, the gravedigger tells Hamlet that he’s been digging graves since the day King Hamlet defeated Fortinbras and Prince Hamlet (who he says is mad and has been sent to England) was born. When Hamlet asks why the prince was sent to England, the gravedigger says because he is mad. He then says that Hamlet will either recover there or not recover and fit right in—because everyone in England is mad. It isn’t difficult to imagine Shakespeare’s English audience erupting with laughter at this joke.
This lighthearted jest at the play’s audience’s expense concludes the moment of levity that occurs just after the death of Ophelia and right before the resumption of the focus on death and tragedy as Hamlet ponders Yorick’s skull

Let me see. (takes the skull) Alas, poor Yorick! I knew him, Horatio, a fellow of infinite jest, of most excellent fancy. He hath borne me on his back a thousand times, and now, how abhorred in my imagination it is! My gorge rises at it. Here hung those lips that I have kissed I know not how oft. —Where be your gibes now? Your gambols? Your songs? Your flashes of merriment that were wont to set the table on a roar?

The play’s somber tone returns with this quote—one of the most famous in the play— when the gravedigger identifies a skull as belonging to King Hamlet’s former jester, Yorick. In a play obsessed with death and decay, the appearance of an actual skull on stage is a climactic moment, and it causes Hamlet to meditate at length on the horror of death and decomposition. It serves as a reminder of the fleeting nature of life and the inevitability of death as the play inches closer to the deaths of most of the remaining main characters in its final scenes. You can read more about this quote in Quotes by Symbol: Yorick’s Skull (the first and second quotes).

Now get you to my lady’s chamber and tell her, let her paint an inch thick, to this favor she must come.

During the in-depth reflection on the fleeting nature of human existence prompted by his holding Yorick’s skull, Hamlet makes this odd aside in which he suggests to the skull that it tell his mother that no amount of makeup is going to forestall the inevitability of death and decay. It is a reminder that no matter what Hamlet is doing or thinking about at any given time, his issues with his mother are never far from his thoughts. You can read more about this quote in Quotes by Symbol: Yorick’s Skull (the third quote).

Dost thou think Alexander looked o' this fashion i' th' earth? …. To what base uses we may return, Horatio. Why may not imagination trace the noble dust of Alexander till he find it stopping a bunghole?
 

During the play’s famous graveyard scene in Act 5, Scene 1, Hamlet asks Horatio if he thinks the buried body of Alexander the Great degenerated in the same way as Yorick’s and smelled as rank, and Horatio says that he believes so. Hamlet then states a rhetorical question asking if it isn’t possible to image the dust of Alexander now being part of a bunghole, which is yet another instance of Hamlet commenting on how human life is fleeting and destined to decay into nothingness.

Some observers have suggested that by musing that Alexander might now exist as a “bunghole,” Hamlet is putting an off-color comical twist on his observation about the brevity of human life—since that word, which strictly speaking means a stopper for the hole of a barrel, also has a scatological meaning to it that existed even in Shakespeare’s day.

You can read more about this quote in Quotes by Symbol: Yorick’s Skull (the fourth and fifth quotes). The explanation of the latter part of this quote (the fifth Quotes by Symbol quote) ties Hamlet’s comment here to his initial lament about the fleeting nature of life in the play’s Famous Quote from Act 2, Scene 2.

Her death was doubtful,
And, but that great command o’ersways the order,
She should in ground unsanctified been lodged
Till the last trumpet.

As the explanation to this quote by a priest at Ophelia’s burial site from Act 5, Scene 1 in Quotes by Character: Ophelia (the sixth quote) discusses, since her unusual death is suspected to have been a suicide, Ophelia’s body will not be buried in hallowed ground, compounding the tragedy of her death and the strain on her brother, Laertes.

I loved Ophelia. Forty thousand brothers
Could not with all their quantity of love
Make up my sum. What wilt thou do for her?

Hamlet makes this statement in Act 5, Scene 1, during an ugly confrontation with Laertes after Hamlet and Horatio unexpectedly happen upon Ophelia’s burial. Whether Hamlet truly loved Ophelia before he directed his cruel words at her when they broke up is one of the many unanswered questions of the play, but with these lines Hamlet vehemently claims he did. Yet, it isn’t hard to see how some might question the veracity of this claim, given that he phrases it in the form of an attack on Laertes and because of its hyperbolic nature (saying he loved her 40,000 times more than did Laertes). To use his mother Gertrude’s phrasing, some might think he “protests too much” here.