Hamlet suspects that his new step-father; Claudius, has murdered his father to then marry his mother and become King. The play Claudius takes so much pleasure in having Hamlet attend is a recreation of the murder of his father and will show Hamlet the guilt of Claudius by reaction. This all being a plot created by Hamlet himself and the play company.