This quote is from Hamlet Act 5, Scene I. Hamlet is in the process of returning to Elsinore and he and Horatio happen across gravediggers preparing a grave. After some banter, the scene progresses to Hamlet's handling of the long-buried skull of Yorick, a jester Hamlet knew well and was very fond of in his youth. Hamlet is pondering the state of life and death and what existence leads to. The paragraph that includes the quote follows:
No, faith, not a jot [he is not being too serious to think like this], but to follow him thither with modesty enough, and likelihood to lead it. Alexander died, Alexander was buried. Alexander returneth to dust; the dust is earth; of earth we make loam; and what of that loam whereto he was converted might they not stop a beer-barrel?
Hamlet then says much the same using Caesar as an example: Caesar's dust might ultimately be used to plug a hole to stop the wind.
This, suggests Hamlet, is what life comes to. Shakespeare here continues the imagery he started when Hamlet jokes to Claudius about Polonius' body being in a place where he is eaten, not where he eats, etc., in Act IV, Scene 3.
This quote, like your last one, is from Hamlet. This time, the quote is from Act V, Scene 1.
This is the famous graveyard scene from the play where Hamlet, at one point, finds the skull of Yorick, who he knew well when he was a child.
The point of this scene, and of the words you cite, is that human beings' lives are fleeting and everyone dies and becomes as nothing in the end. In these lines, Hamlet speculates that Alexander the Great could be being used to plug the whole on a barrel right at that moment. He says Alexander died and became dirt and the dirt could have been dug up and made into a clay stopper for a beer barrel.
These lines are from Shakespeare's tragedy "Hamlet" Act V Sc. 1.
These lines are from the famous Graveyard scene which is a tragi-comic scene meant to amuse the people and provide comic relief even as it highlights certain universally profound truths of human life in gerneral. Hamlet and Horatio arrive at the graveyard where the two gravediggers are digging a grave for Ophelia. As they dig the grave, they dig out Yorick the court jester's skull.
After examining Yorick's skull Hamlet asks Horatio whether or not it would be possible to trace imaginatively the final state of Alexander the Great's human remains. Horatio replies that it would be a freakish and bizarre thing to do so. It is then that Hamlet speaks these lines:
No, faith, not a jot; but to follow him thither with
modesty enough, and likelihood to lead it: as
thus: Alexander died, Alexander was buried,
Alexander returneth into dust; the dust is earth; of
earth we make loam; and why of that loam, whereto he
was converted, might they not stop a beer-barrel?
Hamlet means to imply that even Alexander the Great who was a world conqueror was an ordinary mortal human being like all of us, and that once he died and was buried he became dust. Hamlet remarks that it is quite possible that the dust of Alexander's mortal remains might have become the clay - "loam" - with which beer barrels are sealed tight.
These lines are densely cynical and highlight the worthlessness of all human achievements.