What is the meaning of this saying, The cat will mew and dog will have his day"?"

The line, "The cat will mew and dog will have his day," appears in the William Shakespeare (1564–1619) play, Hamlet, coming at the very end of Act 5, Scene 1. The action in this scene culminates in a fight between Hamlet and Laertes, who is the grieving brother of the dead Ophelia, upon whose gravesite the two men have been arguing fiercely.

Up to this point in the play, Hamlet has killed Polonius (Ophelia and Laertes' father), and sent poor Rosencrantz and Gildenstern to certain death at the hands of the King of England. And, in Laertes' eyes anyway, Hamlet is also responsible for Ophelia's death by suicide.

For these reasons and more, Hamlet's reputation at court is at a very low point indeed, and he knows it. Yet he sees himself as a man on a mission with a just cause: avenging his father's murder. In this context, when Hamlet speaks this phrase in response to Laertes' anger, he is sort of stating the obvious — albeit in a poetic way — according to his view of the situation:

Hear you, sir;
What is the reason that you use me thus?
I loved you ever: but it is no matter;
Let Hercules himself do what he may,
The cat will mew and dog will have his day.

In other words, Hamlet sees himself as a righteous hero (Hercules), who, while he may be considered a lowly no-count creature by others (a dog), will surely (the cat will mew — what else would it do?) have his revenge (his day.)