Any stand-up comic will tell you that the secret to humor is: tell the truth. A good comic tells us things about ourselves that we normally wouldn't want to hear since they are too embarrassing or sensitive. But by getting us to laugh at the truth about ourselves, we learn to recognize our own foibles, and we learn to forgive the foibles of others. Humor is the ultimate defense mechanism. We laugh at human foibles because this allows us to live with them. Laughter is a natural and healthy way to respond when we recognize that someone has offered us a bravely-spoken, but possibly uncomfortable, truth.
But as Thompson notes, not all things that are funny are necessarily true. Humor that exploits stereotypes may make us laugh despite knowing, or even because we know, that the stereotype is inaccurate. They transfer us to the realm of fantasy where stereotypes and magic both work, so we are allowed to laugh or feel awe over things which would otherwise be rejected by better judgement.
Julia Nefsky wrote in Philosophy Now that logical errors in humor can be the essence of the joke, enhance the humor, or be the mechanism for it. Thompson's distinction between laughing at and with the user of the illogic can appear in any of those cases.