This quote is also discussed in our free Shakespeare quotes section. Please see the link below for more information.
Polonius is convinced that Hamlet has lost his mind. However, after talking with him, Hamlet also seems to make sense in what he says. That is because Hamlet is mocking Polonius but Polonius can't see it.
In Act II, scene ii, Hamlet calls Polonius a "fishmonger". This is another way of saying that Polonius is a "pimp". The statement implies that Hamlet thinks Polonius is trying to foist Ophelia onto Hamlet but Polonius doesn't get the point. Hamlet also asks if Polonius has a daughter and then proceeds to tell him not to let her "walk in the sun". This is an obvious reference to Hamlet, himself, who is the "son" of the king. Hamlet then pushes his insults further by saying that old men
( meaning Polonius) have " faces[that] are wrinkled;
their eyes purging thick amber and plum-tree gum; and that they(
have a plentiful lack of wit, together with most weak hams."
Act II, scene ii. lines 208-210
This is an insult aimed at Polonius, who almost gets it and then says that "Though this be madness, there is method in it." In other words, Hamlet is making sense in an odd way but Polonius is too dense to understand it.