What makes us laugh? The following are elements that can create humor.
Incongruity: Something is out of place or goes against our expectations.
Surprise: Something happens unexpectedly, out of nowhere.
Recognition: Something is said that we can relate to.
Inversion: Roles are reversed between two different things.
Repetition: Something is repeated, such as a punchline.
Hyperbole/Understatement: Something is distorted—either exaggerated or understated.
Let's see what elements of humor we can find in "Night-Sea Journey" and "Petition" by John Barth and discuss why Barth might use these elements.
"Do I myself exist, or is this a dream? Sometimes I wonder. And if I am, who am I?" With such deep philosophical musings, the narrator is surely a very intelligent person, perhaps a grad student who takes himself very seriously. The thought process seen in this narrator's internal monologue (focusing on lofty concepts of the self and what it means to be) and the extensive vocabulary used by the narrator help create a mental image in the reader's mind about who the narrator is. The reader might also make assumptions about the "She" that the narrator is journeying towards. It isn't made quite clear, but based on the narrator's lofty internal monologue, one might assume that the narrator's goal is some very lofty aspiration.
And then, whether through picking up on the context clues or being told by a teacher, the reader discovers that the narrator is actually a sperm cell and that the "She" is an egg that he's trying to fertilize. What a subversion of expectations! Rather than a very intelligent and dignified person, the narrator is a tiny speck of a cell which is not even supposed to have a brain or the ability to use language. It's not just a cell, like a blood cell or a muscle cell; it's a sex cell, which is associated with activities that are not exactly intellectually stimulating. This subversion of expectations could be considered incongruity—we wouldn't expect a sperm cell to consider the philosophical questions of his existence—as well as surprise, when we find out that the story is about a sperm cell.
Why does Barth use humor in this way? Overall, this story deals with the very serious themes of misery, grief/loss, and the meaning of life. If it were simply a story of a sulking grad student or a battle-torn war veteran going on and on about how much he has lost in life and how difficult the journey is toward his destination, the story would fall flat. All the deep questions about what it means to be alive would feel extremely boring. However, knowing that the story is from the point of view of a sperm cell—and the ensuing humor—piques the reader's interest and makes us feel more invested in the story.
In "Petition," a conjoined twin writes a petition to the King of Siam (now Thailand) requesting financial support, because he wants to be surgically removed from his conjoined twin, who is completely different from himself. The narrator sees himself as intelligent, good looking, "articulate," "withdrawn," and "stoical," while he sees his brother as an ugly brute: "incoherent," "slovenly," and "gregarious." The narrator does not want anything to do with his brother and wants to be separated.
The humor in "Petition" could be described as dark humor. Dark humor often makes suffering, tragedy, or death the butt of the joke, poking fun at the absurdity of the darkest parts of the human experience. The narrator's plea in "Petition" is darkly humorous, because the reader knows that conjoined twins are typically not able to be separated, so if the king were to fund the narrator's request, the narrator and his twin would likely not survive the surgery. This is an example of incongruity: we would not expect a conjoined twin to seriously consider being surgically removed if it would cause them to die. We would also not expect conjoined twins to hate each other the way the narrator hates his twin—another example of incongruity.
In "Petition," Barth explores a philosophical question of the human condition: What would it mean to be permanently stuck to someone with whom you are completely incompatible? Instead of boring us with some musings on philosophy, he chooses to express this idea in a story, using dark humor to explore the absurdity of what it means to be human.