The bachelor in "The Storyteller" tells the three children on the train a completely inappropriate story that contradicts all the good lessons their aunt has tried to drill into them with a boring, moralizing tale.
However, the children's reactions develop the story's humor because they are very happy about the wicked tale the train passenger tells. Humor works on many levels, and one can be anticipation. We anticipate the children will relish this story, and while the chief part of the humor derives from the story itself, the children's satisfying reactions are part of the charm. We side with the children—all of us want to see the goody two-shoes get her just desserts.
The humor also comes from the story laying bare what we all know—that children have violent, aggressive impulses. Children don't like moralizing stories that talk about the rewards that come to angelic tots who act in more golden and glorious ways than any real child would. Children may also resent children like Bertha, who is singled out for a special reward because of her unnaturally perfect behavior. We laugh because it is so satisfying that this imaginary child gets her comeuppance in such an outrageous way—eaten by a wolf after she clinks her three medals for goodness together, alerting him to where she is hiding. The children fully appreciate the poetic justice of this story's ending.