Enter King, Rosencrantz and Guildenstern:
The King enters with Rosencrantz and Guildenstern, who have apparently just told him that Hamlet wouldn't give them a straight answer about anything. The King's first words, "I like him not" (3.3.1), goes far beyond a statement of personal distaste. The King is using the word "like" as we do when we say "I don't like where this is going."
He gives Rosencrantz and Guildenstern the job of taking Hamlet to England, saying "The terms of our estate may not endure / Hazard so dangerous as doth hourly grow / Out of his lunacies" (3.3.5-7). We know why Hamlet is dangerous to the King, but he isn't about to tell Rosencrantz and Guildenstern that he killed his brother. Instead, he explains it as a matter of "The terms of our estate," which means something like "the nature of my position as king." A king, like a mafia don, must maintain respect, and Hamlet has been showing total disrespect.
Naturally, Rosencrantz and Guildenstern tell the King what he wants to hear, which is that he must indeed be protected, because it's necessary "To keep those many many bodies safe / That live and feed upon your majesty" (3.3.9-10). Rosencrantz and Guildenstern are sucking up to the King, but what they say about kingship was generally true. In Shakespeare's day, a King was much more powerful than any president or prime minister is today, and only a strong king could keep his country safe. So, most people in Shakespeare's audience would agree with Rosencrantz's last words in the scene: "Never alone / Did the king sigh, but with a general groan" (3.3.22-23).
Exeunt Rosencrantz and Guildenstern. Enter Polonius:
Just after Rosencrantz and Guildenstern hurry out, Polonius comes hurrying in. He's on his way to hide behind the "arras" (a heavy curtain), so that he can overhear the conversation between Hamlet and his mother. Polonius' original idea was that by doing this, he could prove that "The origin and commencement of [Hamlet's] grief / Sprung from neglected love" (3.1.177-178), but now he seems more interested in seeing to it that the Queen "tax him home" (3.3.29), that is, scold Hamlet into being a good boy. The King's only response is "Thanks, my dear lord," because he doesn't really care. He's already made arrangements to send Hamlet to England.
Now the King is alone with his conscience. This soliloquy, though not as famous as any of Hamlet's, is just as psychologically persuasive. At the performance of The Murder of Gonzago the King got spooked, but he didn't admit anything to anybody. Hamlet may have figured out what happened, but the King doesn't know that for sure, and he's about to get rid of Hamlet. Still, he feels exposed. He feels that he stinks to heaven. Perhaps no one else knows his secret, but God knows. As he says, "O, my offence is rank, it smells to heaven" (3.3.36). He tries to pray, but cannot. He knows that any sin can be forgiven, but he also knows that for a sin to be forgiven, it must be repented, and he cannot truly repent, because "I am still possess'd / Of those effects for which I did the murder, / My crown, mine own ambition and my queen." (3.3.53-55). God doesn't allow a thief to say "I'm sorry" and keep the money. In this world, if you steal enough money, you can hire an all-star team of defense lawyers, so that "Offence's gilded hand may shove by justice" (3.3.58), but "'tis not so above." So, at the end, he urges himself on, asks the angels to help him, and tells his knees they must bend. He kneels, saying "All may be well."
As the King kneels, Hamlet happens by and sees him. Hamlet says "Now might I do it pat, now he is praying / And now I'll do't" (3.3.73). As he says this, it's usual to see Hamlet take out his sword and step towards the King, as though he's about to stab him the back. But then Hamlet says to himself "and so 'a goes to heaven, / And so am I reveng'd," and hears what he is saying. If the King does actually go to heaven, that wouldn't be revenge, but "hire and salary." So Hamlet decides that he'll wait until he can catch the King when he is certainly in a state of sin, "When he is drunk asleep, or in his rage, / Or in the incestuous pleasure of his bed" (3.3.89-90). Hamlet puts up his sword and leaves to speak with his mother. After he has gone, the King rises and says, "My words fly up, my thoughts remain below: / Words without thoughts never to heaven go" (3.3.97-98). Thus we see that his attempt to pray failed, and that if Hamlet had killed him, he would not have gone to heaven. So Hamlet's habit of thinking about his own thinking saved his enemy's life.