In Shakespeare's play, Hamlet, in Act Two, scene one, Polonius is sending materials with Reynaldo to give to Laertes who is away from school. In addition, Polonius wants Reynaldo to spy on Laertes because he does not trust him and is something of a control freak.
First Polonius wants Reynaldo to make private inquiries into Laertes' behavior. Polonius tells Reynaldo to ask all kinds of questions so that no one will know that Polonius is asking. Reynaldo may admit that he knows the family. Polonius offers Reynaldo a wide variety of ways to seek information about Laertes, and Reynaldo protests as he doesn't wish to dishonor Laertes. Polonius says this will not happen. To find out about Laertes, Reynaldo must lie. And in these lies, Reynaldo will get the information he needs, no matter how he has to do it.
Polonius likewise tells Reynaldo that in whispering untruths, sometimes the real truth comes out. Polonious believes that by using "indirections," or non-truths, he can trick Laertes or his friends into sharing truths about Laertes' behavior, to know really how he is acting away from home. Polonius insists that this is the only way to learn what Laertes is really doing. He suggests that by providing "indirection" Reynaldo can find out the truth.
With windlasses and with assays of bias,
By indirections find directions out.
So, by my former lecture and advice,
Shall you my son.
On the other hand, where Polonius is sneaky in trying to find out the truth about Laertes, Hamlet pretends to be insane to get the information out of Polonius and others. Hamlet acts silly and crazy, in order to put those around him at ease. They cannot make sense of what Hamlet is thinking, but imagine all kinds of things regarding Hamlet crazy behavior; meanwhile he is able to throw the others off balance while he watches and listens. Reynaldo may not get much information from the people where Laertes is because he is an outsider. Whereas Hamlet is listening and learning what different plans the King and Polonius may have for him, and they may not be so careful because though they believe his is insane—however, he is not really mad, but vigilante.
Ironically, both Polonius and Hamlet are doing things to gain information about someone else. Polonius reveals the kind of person he is by spying on his son and encouraging Reynaldo to lie about him to get the information he wants. Polonius is also sneaky in trying to gain information about Hamlet, but Hamlet is well-aware of what the King and Polonius are up to, so he, too, is sneaky to find out information, but also to keep the others from learning too much about him.