What was Big Willy Shakes going for?
Polonius points out what we already know: that Hamlet is faking his madness. But that's not the whole story. Polonius and Claudius may know that Hamlet is pretending, but they don't know why he's acting that way.
Of course as it turns out, it's all one big joke. Hamlet's pulling a fast one over on everyone, and they're scrambling to figure out what's going down. Polonius is at the center of this. He thinks he's got Hamlet all sized up. But he's actually missing a lot of what's happening right in front of him.
Polonius chalks Hamlet's comments up to his madness and says they're immaterial. But are they? Polonius first asks if Hamlet recognizes him, and Hamlet replies he knows him as a "fishmonger" (that's a guy who sells fish, but it's also slang for "pimp"). Maybe that means Hamlet knows Polonius is using his daughter and her romantic relationship with Hamlet, for personal gain. After all, spying for Claudius = getting in good with the king.
Hamlet also quips with Polonius that honest men are rare, and that the sun would breed maggots in a dead dog because that flesh is good enough to be kissed by the sun. We're not really sure where he's going with all this until he brings it back to Ophelia. Hamlet says she should be kept out of the sun, as the sun would likely conceive with her too, thus likening our delicate Ophelia's womb to a dead dog rotting in the sun, which would then breed maggots. Nice way to talk about your crush, Hammie.
So Hamlet is making fun of Polonius while the poor old guy has no idea. See, Hamlet's no fool. But there's also something deeper going on here. Shakespeare has taken it up a notch. He doesn't just make Hamlet bonkers; he uses Hamlet's cuckoo-talk as an act to expose the truth. Here, Polonius notices that Hamlet has control over his madness, almost like an actor does over his performance.
Shakespeare seems to be slamming all actors with this line. Think about it. If madness is a form of theatricality (maybe with some "method" in it, as Polonius says)—does that mean that all actors are crazy to some extent?
We're pretty sure the audience would have found that hilarious.