Court jesters were "licenced fools," meaning that they were given licence to do whatever they wanted as long as it was funny or instructive. They were allowed, and even expected, to make fun of anything and everything going on around them.
A good example of a jester and the things jesters did, was a man named George Buchanan, who worked for King James VI of Scotland. He noticed that the king usually signed state papers without reading them, so he slipped a paper of his own into the kings work. Before King James knew what he was doing, he had signed a royal decree abdicating the crown to a certain George Buchanan for a period of two weeks.
Jesters were not trained to be jesters. They were funny people who could make people laugh and were unafraid to say things other people would not be willing to say. When such a person became well known locally, he or she was brought to the attention of a person of sufficient status to hire such a jester, and got the job in this way. A nobleman who wanted favor of someone higher up might send him a good jester as a way of getting that favor. And so the kings got the best.
The whole business was without regulation or traditions to enforce. That was its nature. And so the deal a jester got depended on what deal he could strike with the person he worked for.
But the jester's job was to get information on the household, the guests, and the lord, and make light use of it at any time, spontaneously, as required. A stand-up comic could not have done this, because it required new material all the time. So a lord who wanted to get best use of his jester had him in the household all the time, for example, having the jester eat his meals close to the lord, where he could observer everyone and make comments on anyone where the lord could hear him.