Hamlet becomes more bitterly philosophical concerning fate and man's place in the world through the events of Act IV. In the previous act, Hamlet had actually made an attempt to kill Claudius, but stopped because he found Claudius praying, or so hamlet thought.
Unfortunately, in a fit of shock and alarm, Hamlet then slays Polonius, whose identity Hamlet did not know since Polonius was hiding behind the arras in Gertrude's room.
After being shipped off to England by Claudius as punishment for the slaying and while escaping the attempt on his life by switching the letter being carried by Rosencrantz and Guildenstern, Hamlet is captured by pirates and returned to Denmark. He has become far more cynical and worldly wise for having caught Claudius, Rosencrantz and Guildenstern red-handed in betrayal and a plot to assassinate him.
In the end of the play we can notice that Hamlet's reactions are becoming more obsessed and bitter towards Claudius and his mother. He even starts to speak in a more bitterness tone. Hamlet grows madder when he decides to describe the sexual encounters of his mother more in details: “Let the bloat king tempt you again to bed, /Pinch wanton on your cheek, call you his mouse, /And let him, for a pair of reechy kisses, /Or padding in your neck with his damn’d fingers,” (4.1.182-185).
in Act IV the biggest change in Hamlet is that he recognizes that he is delaying his revenge, and he begins to formulate a plan. This is a big change because previously he was actively delaying, but not directly speaking about his delay, and not forming plans. We can see Hamlet start to change into someone who will eventually act at the end of the play and get his revenge.
We also learn that Hamlet's "madness" is fake, so we see that he does have the ability to lie and pretend, which is what he also hates about others.