In Hamlet the play is the thing wherein to catch the conscience of the king. Claudius has committed the perfect crime. He has killed the king and taken his place. Now months later he betrays himself. Well he gets so taken up in a play that he forgets himself and starts making incriminating comments.
Words are a powerful weapon.
A few words and all suspicions are allayed. But he makes a mistake. He lets Marc Anthony speak after him. Anthony is bound not to say anything against the conspirators. And even within that restriction, Anthony turns the crowd.