This is one of several Simpsons episodes which are considered anthology episodes that features mini-stories.
In a parody of Perfect Strangers, the two aliens Kang and Kodos are preparing the Simpsons for dinner for their "boss." Bart and Homer are the main course, Lisa is in a soup, and Marge and Maggie are pies. The boss comments on the delicious meal, but his stomach bursts and Bart falls out in a river of vomit. For their meal, Kang and Kodos get a hyper-galactic promotion. Bart is upset about being an orphan, but he is adopted by Kang and Kodos. Then, the theme song from Perfect Strangers plays as the Treehouse of Horror logo appears on the screen; an alien tentacle stamps the "XV" underneath which makes it read, "Treehouse of Horror XV".
The Ned Zone
In a parody of The Dead Zone, while trying to get his Frisbee from the roof, Homer throws a bowling ball that hits Ned on the head. When Ned recovers in the Springfield General Hospital, he has a vision of Dr. Hibbert falling out of a window, which happens shortly afterwards when Homer asks him to get his Frisbee from the window ledge, killing Dr. Hibbert. Ned realizes that he can see the deaths of people whom he touches; he saves Hans Moleman from falling down from a telephone line and has a vision of him getting chewed up by alligators. In shock, he drops Hans right into an open manhole containing the alligators, which he was standing next to. He also predicts the closing of The Rosie O'Donnell Musical musical theater, but he "didn't need special powers to see that one coming!"
Later, one of his visions depicts him shooting Homer. When Homer finds out about Ned's vision, he taunts him and even gives him Chief Wiggum's gun to shoot him with. Ned refrains from shooting Homer and has another vision of Homer blowing up Springfield. Ned tries to dissuade Homer from going to work saying that he will destroy the town, and Homer promises he will never go back... "after today, because it’s Lenny's birthday, and they are serving ice cream cake".
Ned rushes to the power plant to stop Homer, who for some reason is eating the cake in the plant’s control center while everyone else is eating it in the staff room, his warning is scrambled by static over the intercom, leading Homer to believe he should press the "core destruct" and "kill everyone" button, despite that obviously being a stupid thing to do. In desperation, Ned grabs a nearby security guard's gun and shoots Homer (reenacting his previous vision of shooting Homer); but in his death throes, when Homer presses the destruct button with his tongue, causing the power plant to explode and a large chunk of central Springfield is destroyed. Ned, Homer, Marge, all the Simpsons, and the garage (made it to heaven because Marge thought Homer blew up Springfield to avoid cleaning the garage) go to heaven as angels and they meet God who "proceeds to give Homer what is coming to him", which happens to be his frisbee.
Four Beheadings and a Funeral
In a parody of From Hell, which takes place in 1890 London, women are being killed with swords in a series of unsolved murders by "The Muttonchop Murderer" (a spoof of Jack the Ripper). Scotland Yard's Inspector Wiggum challenges master detective Eliza Simpson and her assistant Dr. Bartley to follow the swords that were bought in a shop by C. Ebenezer Burns. They find them in an opium den, where he claims he lost all his wealth to opium.
The next suspect in mind is Homer. The police arrest Homer and are about to hang him when Eliza finds the real killer: Inspector Wiggum, whose knife handle of the third body is covered by the smell of pie eels. Wiggum objects that many people like that pie and tries to escape in a hot air balloon, which is destroyed by the spaceship of Kang and Kodos. However, it turns out to be a dream that Ralph Wiggum was having while smoking opium in an opium den, which is still part of a dream.
In the Belly of the Boss
In a parody of Fantastic Voyage, at the "Invention Expo", Professor Frink creates a machine that shrinks objects. Maggie, believing that it is a giant ball pit, crawls inside a giant pill, which is miniaturized and swallowed by Mr. Burns. After discovering Maggie's disappearance, the rest of the family agrees to be shrunk within a craft and injected into Burns' body. When Homer refuses to follow Frink's instructions, the ship gets stuck in Burns' heart. The crew puts on their spacesuits (all except Marge) to un-wedge the ship. Marge is wearing a swimsuit that is tight around her body, until white blood cells attack it, showing her navel. The crew manages to get the ship free and are able to reach the stomach by catching a ride on a nerve impulse. They manage to save Maggie, but are forced to leave someone behind due to Maggie's extra body weight -- Homer due to him weighing more than anyone else in the family. The submarine successfully escapes, but there is not enough time to save Homer. Homer returns to his original size inside Mr. Burns' skin and both yell in extra pain.
Even though Homer complains that he needs several holes, Burns is confident that matters will work out, and it ends with Mr. Burns and Homer leading a dance to the tune of I've Got You Under My Skin, with most of the entire cast from all three segments and the opening sequence of the episode joining in as well.