Vending machines appear at Springfield Elementary School, and Bart quickly gets hooked on the junk food they dispense. He gains a large amount of weight and has a heart attack. When Bart can't stay on a healthy diet, he is sent to a maximum-security fat camp to kick his junk food habit. Back at home, the family is faced with large bills for Bart's treatment, and needs extra income in order to pay for it. They convert the house into a youth hostel which brings in the money they need, but also attracts an unfriendly and demanding crowd of German tourists.
The machines talk in hip-hop slang and feature strangely named snacks, some of which contain harmful ingredients such as depleted uranium. Except for Lisa, none of the kids care about the harmful snacks, and they eagerly line up to feed their money into the machines and chow down on the snacks they dispense. The vending machines' biggest customer is Bart, who becomes hooked on the junk food to the point where he won't eat any food that doesn't come from the machines, even rejecting Marge's lovingly prepared tuna steak. In just three weeks, he gains an enormous amount of weight and suffers a heart attack.
Bart sees Dr. Hibbert, who says that junk food—specifically, malted milk balls—has clogged his arteries. Bart, however, doesn't change his eating habits, almost continuously eating the snacks until Marge puts him on a diet. When Bart can't stick to the diet, the family and some friends and neighbors stage an intervention and send Bart to Serenity Ranch, a maximum security fat camp. Also at the camp are Apu, Rainier Wolfcastle (who was last seen fattening up for a movie role), and Kent Brockman, and the camp's counselor is none other than former junk food magnate Tab Spangler (who is dealing with many anger issues). However, the family is faced with large bills for Bart's treatment. To pay for the camp, the family converts their house into a youth hostel which attracts German tourists.
Bart does not do well at the camp, and Spangler takes him home to show him what the family is going through in order to afford the treatment. Bart is horrified to see his parents and Lisa abused and humiliated by their German boarders. Spangler suggests Bart fight his addiction, and Bart takes the suggestion literally, breaking into the school and destroying the vending machines with an axe. He then steals the money from the vending machines, and goes home and announces that he's cured, as he's finally seen the true cost of his addiction. The family decides to use the money to pay for the fat camp (even though the money is ill-gotten) and give the Germans "Das Boot." Tab Spangler says that they still have three weeks of non-refundable treatment left, and Homer goes with Spangler back to the camp (whether by choice or otherwise is unknown). The episode ends with Homer and Spangler driving in Spangler's car and getting into an argument over the cheeseburger that Homer is eating.