At the end of Scene 2 in Act 3, Hamlet speaks the following lines:
Soft! now to my mother!
O heart, lose not thy nature; let not ever
The soul of Nero enter this firm bosom.
Let me be cruel, not unnatural;
I will speak daggers to her, but use none.
My tongue and soul in this be hypocrites
How in my words soever she be shent,
To give them seals never, my soul, consent!
Shakespeare wants to make it clear to the audience that Hamlet has no intention of harming his mother. This fact will be important in Act 3, Scene 4, because Gertrude gets the false idea that Hamlet intends to murder her. She cries for help, and Polonius, who can't see anything from where he is hiding, echoes her cries, believing, as Gertrude does, that she is in mortal danger. Gertrude believes her son is insane from the time he first enters her room. This leads to a mixup and then to tragedy. Hamlet is being impertinent. When she asks, "Have you forgot me?" he replies:
No, by the rood, not so!
You are the Queen, your husband's brother's wife,
And—would it were not so—you are my mother.
This angers Gertrude. She says:
Nay, then, I'll set those to you that can speak.
Hamlet has come there with the intention of having it out with his mother. He wants to tell her how he feels about her marrying Claudius and especially doing it so soon after his father's death. He is not at all sure that she was not in collusion with Claudius in her husband's murder, or at least that she didn't have some kind of illicit relationship with Claudius before her husband was found dead. Hamlet probably grabs her by the wrist when he says:
Come, come, and sit you down. You shall not budge.
You go not till I set you up a glass
Where you may see the inmost part of you.
This results in an unusual mix-up. Hamlet is speaking metaphorically, but his mother, who thinks he is insane, takes him literally! He simply means that he intends to use words to make her look at herself and see her own improper behavior. But she gets the idea he intends to set up a mirror and then use his sword to cut her open and make her look at her own intestines as she is bleeding to death. That is why she says:
What wilt thou do? Thou wilt not murder me?
Help, help, ho!
Hamlet hadn't the slightest intention of hurting his mother. He cannot understand why she is crying for help. She is crying for help because she thinks her son is completely crazy and intends to kill her in a horrible and bizarre fashion. Then Polonius, who is behind Hamlet and in hiding, starts crying for help too.
What, ho! Help, help, help!
Now Hamlet thinks he has walked into a trap. He thinks his mother has sent for him because she was planning to call the guards and have her son apprehended. This would mean that she is in collusion with the king and that he could get thrown into a dungeon, where he might remain for years or be murdered. He would never have a chance to get his revenge against Claudius. In fact, it might be Claudius who is hiding behind the arras. So in self-defense Hamlet draws his sword and stabs the hidden man who is echoing Gertrude's cries for help from the palace guards.
Now that Hamlet is holding a bloody sword, Gertrude is really petrified. She thinks she is about to be killed by a lunatic. She has stopped calling for the guards because she saw what happened to Polonius for doing that. She offers no further resistance. Hamlet can now make her sit down and can give her the scathing tongue-lashing which is the outstanding feature of this marvelous scene. It includes these inspired lines:
Nay, but to live
In the rank sweat of an enseamed bed,
Stew'd in corruption, honeying and making love
Over the nasty sty!
O, speak to me no more!
These words like daggers enter in mine ears.
No more, sweet Hamlet!
A murderer and a villain!
A slave that is not twentieth part the tithe
Of your precedent lord; a vice of kings;
A cutpurse of the empire and the rule,
That from a shelf the precious diadem stole
And put it in his pocket!
By the time this turbulent confrontation between mother and son is over, she no longer believes he is insane, and he no longer suspects that she knows anything about how his father really died. Later she will tell Claudius that Hamlet is:
Mad as the sea and wind, when both contend
Which is the mightier.
But she no longer believes that. She is keeping Hamlet's secret and protecting him from punishment for killing Polonius by asserting that her son is totally insane.