To discuss the significance of the soliloquy as it is used in Hamlet, it is important more than anything else, to understand this dramatic technique, which then speaks directly to how Shakespeare uses it in not only Hamlet, but in perhaps all of his plays.
eNotes defines the "soliloquy" as...
...a speech delivered by a character in a play or other literature while alone, or an utterance by a person who is talking to him/herself...
The character, as stated, may be alone on the stage—or may be with others—but speaks aloud so the audience can hear his inner thoughts and feelings, while if there are other characters on the sgate, they are oblivious to what is being said. This dramatic technique gives the audience a look into the heart and soul of the character speaking, providing background information or a clearer understandeing of the character, which—in turn—moves the plot along. (And this stands true for heroes and villains alike.)
For example, one famous soliloquy in Hamlet is his "To be or not to be" speech. Another is found in Act One, scene two, lines 132-162. It may be referred to by some as the "Oh, that this too, too sullied flesh would melt" speech. In this case, Hamlet is reeling from his father's recent death. He is appalled by his mother's overly-hasty marriage to his uncle. This upsets him because Gertrude (his mom) seems to have so quickly forgotten her dead husband, Old Hamlet, who (according to Hamlet) doted on his wife—and she on her husband:
…so loving to my mother
That he might not beteem the winds of heaven
Visit her face too roughly. Heaven and earth!
Must I remember? Why, she would hang on him
As if increase of appetite had grown
By what it fed on… (143-148)
In addition, the marriage would have seemed unnatural to the character of Hamlet and to Shakespeare's Elizabethan audience because marrying her brother-in-law meant (socially and morally) that she was committing incest. When a man and woman married, they believed, the two people became one. So when Gretrude sleeps with her brother-in-law, that part of her that is also her dead husband is sleeping with his brother. Hamlet is further mortified by this.
Hamlet also bemoans the fact that feeling as horribly as he does, he cannot commit suicide because of God's laws against it:
...Or that the Everlasting had not fix'd
His canon 'gainst self-slaughter! (134-135)
Throughout this one soliloquy, we learn not only what has been happening in Denmark since Hamlet's father died, but also how Hamlet feels about it all. It helps to set the mood, for this is a tragedy, and allows the audience to make an emotional connection with this tragic hero.
The soliloquy is a valuable tool in drama, and Shakespeare used it masterfully.
THE SHAKESPEARIAN SOLILOQUY IS THE PRECURSOR OF OUR MODERN DAY CINEMATIC TECHNIQUE WHERE THE CAMERA TAKES A REAL CLOSEUP OF THE ACTOR'S FACE AND THEN A VOICE IS HEARD ON THE SOUNDTRACK EVEN WHEN THE ACTOR'S LIPS ARE NOT MOVING ...AND WE KNOW IMMEDIATELY THAT WE ARE LISTENING TO THE THOUGHTS OF THE ACTOR...THIS METHOD IN CINEMA TODAY IS THEREFORE REALLY AN UPDATE OF A TECHNIQUE USED BY SHAKESPEARE TO REVEAL THE PSYCHOLOGY OF THE ACTOR ...TO ENTER HIS OR HER MIND...TO HEAR WHAT S/HE IS THINKING ...AS DIFFERENT FROM WHAT S/HE IS SAYING TO OTHER ACTORS ON STAGE ... IT IS A BRILLIANT PSYCHOLOGICAL TECHNIQUE , WHERE THE ACTOR SPEAKS HIS MIND , BUT TO THE AUDIENCE ..AND NO OTHER ACTOR OR ACTRESS HEARS THE SPEECH EVEN WHEN THEY ARE ALL ON STAGE ! it is therefore a monologue, not a dialogue...THIS IS THE SOLILOQUY...THAT WAS ABSOLUTELY required by Shakespeare BECAUSE IN HIS PLAYS , UNLIKE THE PLAYS OF THE GREEKS where humans were driven by the Gods, IN SHAKESPEARE'S VISION IT WAS HUMAN PSYCHOLOGY THAT DROVE HUMAN BEINGS EITHER TO THEIR DOOM OR THEIR HAPPINESS..SO A TECHNIQUE TO REVEAL WHAT WAS GOING ON INSIDE THE HUMAN MIND WAS ESSENTIAL ...AND THIS IS THE SOLILOQUY !