Hamlet's encounter with the grave diggers and Yorick's skull is an important sign of Hamlet's development. Throughout the play, death is always present, whether it is taking the form of dead fathers, ghosts, revenge plots, murder, or suicide. "To be, or not to be?" is not just a question of existential despair; it becomes a very real question about life and death and the "undiscover'd country." In many ways, this more philosophical approach toward the problem of death distinguishes this play from the many other revenge tragedies of the era, which revel in passion and revenge plots.
It is challenging to put into words what has transpired within Hamlet since his setting off for England with Rosencrantz and Guildenstern. He has obviously arranged for his friends to be killed and has escaped with pirates, who set him down in Denmark. He seems also temperamentally a different person. In these first moments upon his return, he seems to have made a certain peace with some aspects of his situation, but Yorick's skull, tossed unceremoniously up from the grave, is a literal memento mori, that frequent trope in early modern art.
Holding the skull of his former companion, Hamlet sees death in its immediate and tangible sense, leading him to reflect on the common experience all humans share. From his early contemplation of "self-slaughter" to his accidental and intended murders to this confrontation with the very sign of death, Hamlet grows from a self-absorbed sorrow for his father's death to a resigned acceptance of death. This recognition seems to be the understanding that allows him to finally accept that he will indeed die. In 5.2, just before his fateful fencing match, he tells Horatio,
If it be now, ’tis not to come. If it be not to come, it will be now. If it be not now, yet it will come—the readiness is all. Since no man of aught he leaves knows, what is ’t to leave betimes? Let be. (5.2)
Yorick's skull is the symbol of that inevitability of death.