After nearly drinking a candle, Homer decides to coat the roof of his his mouth with melted wax, enabling him to eat several of the peppers, leaving Wiggum and the crowd astonished. The peppers bring on a hallucination in which Homer is trapped in a bizarre fantasy world. He encounters a large snake, a gigantic butterfly, a tortoise and destroys the sun. He finally arrives at a large pyramid and meets his spirit guide - a coyote. The coyote advises Homer to find his soulmate, and questions Homer's assumption that he has already found her in Marge. Meanwhile, Marge hears of Homer's strange behavior and, believing he has broken his promise, drives home.
The next day, Homer regains his senses while lying in a golf course sand trap. He rationalizes his dream, comparing the desert he wandered in to the sand trap, and the talking coyote with a passing talking dog. (The dog barked three times, and Homer said, "Damn straight!") After returning home, he finds Marge angry with him for his odd behavior at the cook-off. This leads to Homer making note of their fundamental personality differences, causing him to question if Marge is truly his soulmate, and he leaves. Filled with doubt, he searches elsewhere for a soulmate, yet fails in each instance.
Eventually he becomes convinced that a lighthouse keeper might be his soulmate, since they would both be theoretically lonely individuals. Instead he finds the lighthouse is operated by a machine. Seeing an approaching ship, Homer destroys the lighthouse's light in hopes that it will cause the boat to come closer and the people inside will befriend him. Marge arrives, having known exactly where Homer would go, and the pair realize that they really are soulmates. Meanwhile, the ship runs aground, spilling its precious cargo of hot pants, even though Marge was able to change the lightbulb Homer broke. The citizens of Springfield happily retrieve the pants while Marge and Homer embrace.
The episode was pitched as early as the third season by George Meyer, who was interested in an episode based on the books of Carlos Castaneda. Meyer had wanted to have an episode featuring a mystical voyage that was not induced by drugs, and so he decided to use "really hot" chili peppers instead. The staff, except for Matt Groening, felt it was too odd for the show at that point. Bill Oakley and Josh Weinstein resurrected the story, and decided to use it for season eight.
Most of the hallucination sequence was animated completely by David Silverman. He wanted it to look exactly as he had imagined it, and did not want the risk of sending it to South Korea. The coyote was intentionally drawn in a boxier way so that it looked unlike the other characters. During Homer's voyage, the clouds in one shot are live-action footage, and 3D computer animation was used for the giant butterfly. During the same hallucination, Ned Flanders' line was treated on a Mac computer so that it increased and decreased pitch. The Fox censors sent a note to the writers, questioning Homer coating his mouth with hot wax. The note read: "To discourage imitation by young and foolish viewers, when Homer begins to pour hot wax into his mouth, please have him scream in pain so kids will understand that doing this would actually burn their mouths."
Homer waking up on a golf course was a reference to something that happened to a friend of the producers, who blacked out, waking up on a golf course in a different state. He had to buy a map from 7-Eleven in order to find out where he was. He then had to walk several miles in order to get back to his friend's house, which was the last place he remembered being the night before.