The play Queen and King started to get nervous to keep playing their roles as the play continued. Hamlet noticed the King acted very guilty towards the end forcing Hamlet to think this proves him guilty.
Hamlet catches Claudius praying ruining his whole game plan. Hamlet was thinking if he were to kill right there he would go to heaven somewhere where Hamlet believes he doesn't belong. However, Claudius was trying to pray but failed too.
Hamlet then goes to his mom and confronts her on everything he has heard about his moms thoughts on his behavior. As he is talking to his mom Polonius comes to spy on Hamlet and he then gets killed because Hamlet was expecting Claudius to be spying on him.