Note to King Lear, 1.4.201: "all-licens'd fool"
Fools, who provided relief from the stifling formality of court life, were assumed to be half-wits, and therefore allowed to say anything at all. No one was allowed to take offense, because a fool's statements were presumed to be foolish. However, Shakespeare never portrays a fool who is an actual half-wit; all of Shakespeare's fools are acute and insightful. I would guess that this was also often the case in real life.
King Lear and the Fool by Gustav Schauer