Your average fantasy story relies on some, at the least, improbable things being allowed to occur unimpeded, like the impetuous attractive protagonist and the virtuous attractive love interest having their relationship coincide with the precarious affairs of the state. So effective parodies often make hay by making things more complicated, which is the case with 1956's The Court Jester. Many unforeseen complications take this would-be Robin Hood tale right off the rails despite the best and worst intentions of its characters and the result is one of the greatest comedies of all time.
Danny Kaye stars as Hubert Hawkins, not a court jester but a former carnival performer who's joined up with the merry men of the Black Fox (Edward Ashley). The Fox is basically Robin Hood, robbing the rich and giving to the poor in defiance of a tyrant, Roderick (Cecil Parker), who's seized the throne. The rightful heir is an infant and in the care of the Fox. Part of Hubert's duty is to flash the purple pimpernel on the baby's butt to confirm the lad's royal status to the crew.
Hubert and Jean (Glynis Johns), one of the Fox's captains, are charged with taking the baby, hidden in a wine cask, to an abbey where it'll be safe. But on the way, Hubert and Jean fall in love and run into the jester Giacomo (John Carradine in a cameo) who's on his way to the castle. Jean immediately realises it's an opportunity to smuggle Hubert into the castled in the guise of Giacomo where he can steal a key from the king's quarters, enabling the Fox and his men to sneak in and take the castle through a secret passage.
It all seems simple enough, though audiences might have already been disconcerted by the fact that the Black Fox isn't the main character. But now the plates really start spinning because at the castle there are two plots already cooking against the king--one from his daughter, Gwendolyn (Angela Lansbury) and her witch servant, and another from the king's advisor, Ravenhurst (Basil Rathbone), who's plotting to kill some new rivals for the king's patronage. The comedy comes from how these plots unpredictably intersect due to each player's imperfect understanding of the situation.
Kaye is quite good, not just at the funny stuff but his sword fight at the end with Rathbone has some of the energy and skill seen in the duel between Rathbone and Errol Flynn in Robin Hood. Lansbury is very good but even more crucial is Glynis Johns in a role many directors might have been content to cast with a lightweight. But playing the straight requires a special skill--a big part of how well the famous "vessel with the pestle" bit works is Johns' ability to say the tongue twister like it's so easy she truly can't understand why Hubert can't get it. She also has a pretty funny scene where she convinces the king she has a terrible contagious disease in order to ward off his advances.