The actors are recreating the death scene of King Hamlet by showing how his brother killed him and took over everything he had.
Hamlet seeks the perfect opportunity to kill the King but realizes that if he kills him while he's praying then he will go to heaven. So Hamlet is waiting to catch him off guard.
Hamlet and his mother have a conversation and it gets intense so Hamlet reacts and his mother yells out for help and Polonius reacts. But Hamlet thinks Polonius is the king and stabs him and kills him. Act 3 Scene 4