Daydreaming Principal Skinner is looking for a company to sign a vending machine contract with Springfield Elementary, with half of the machine's profits going to the school. He looks at suggestions of a gumbo machine from the Sea Captain that seriously burned the Sea Captain's hand and from Gil and rejects them, until he gets a suggestion from Lindsey Naegle. The unhealthy vending machines sponsored by hip-hop artists are installed, and most of the students use the machines (save for Lisa, who protests their extremely high sugar content and artificial additives), but Bart is seen using it the most frequently. Due to the high fat and sugar content in the snacks, and due to the high frequency of their consumption, three weeks later, Bart significantly gains weight and becomes overweight, and during an in-show parody of the opening credits, he suffers a heart attack after slowly trying to make it home from school.
Bart sees Dr. Hibbert, who says that malted milk balls have clogged his arteries, and that a wad of Laffy Taffy is blocking his liver. He informs the family that Bart is addicted to junk food and tells Marge to put him on a diet. However, Lisa discovers that Bart has been hiding junk food in his walls, and the family stages an intervention. When Bart tries to run away, due to his widened and obese frame, he gets stuck in a fence and is caught by two representatives of a maximum security fat camp, Serenity Ranch. Bart ends up there with Apu, Rainier Wolfcastle (who was last seen fattening up for a movie), and Kent Brockman, and the camp's leader is none other than former junk food magnate Tab Spangler (who is dealing with many anger issues). However, when Bart is there, the family is faced with an expensive bill. To pay for the camp, the family converts their house into a youth hostel, which attracts German tourists.
At the fat camp, Bart cheats by sneaking food, so Tab Spangler takes him home to visit the family to show him the horrors that occur. His family is working continually to appease the students staying in their home. The Germans humiliate the family, making Homer dance for change and forcing Marge and Lisa to clean intentional messes while pointing out America's problems one by one. He suggests Bart fight his addiction, and he does, by destroying the vending machines in school. His addiction to junk food is over, and he steals the money from the vending machines, which the family uses to pay for the bill and give the Germans "Das Boot". Homer gets revenge by beating up the Germans, and tossing them out. Tab Spangler says that Bart still has three weeks left of non-refundable treatment, and Homer goes with Tab (by force from the family), where the episode ends with them driving in Tab's car arguing over the cheeseburger Homer is eating.