A badger takes up residence in Santa's Little Helper's doghouse. After several failed attempts to lure it out (including Homer crawling into the kennel, thinking it is Milhouse but getting attacked by the badger), Homer calls animal control. When he is unable to get through, Marge explains that the phone company has introduced a new area code to Springfield. Half of the town now has a 636 area code, the other has 939. At a town meeting to explain the change, Homer rallies an angry mob to protest the change, noting that the upper class side of town got to keep their area code while the poorer half were forced to switch. Homer proposes that the town split into two halves, and the mob agrees.
Homer is declared mayor of New Springfield after rejecting a franchise offer from the Arizona Cardinals and tensions immediately arise between the two towns. While unveiling the 'Olde Springfield' town plaque, Mayor Quimby attempts to bond with New Springfield, but Homer throws a beer can at him. Old Springfield businesses begin discriminating against customers from New Springfield, and condescending to them on the nightly news. Bart and Homer shut off the power to Old Springfield. Old Springfield retaliates by hijacking a beer truck heading for New Springfield and dumping its contents in the river; Homer and New Springfield then cut off their water supply. When the lack of water reveals gold in the river bed, making Old Springfield even richer, an enraged Homer has a wall built between the two towns. However, a lack of supplies and sanitation drives away all of the New Springfield residents, who stream over the wall, leaving the Simpsons alone.
Bitter, Homer attempts to sabotage a concert in Old Springfield by The Who. He and Bart sneak into The Who's hotel room and convince them to play New Springfield instead. When Old Springfield realizes that their concert has been stolen, they follow the sound of the music to the wall, where The Who are playing for an audience of The Simpsons. A riot begins to break out as the residents of Old Springfield begin hurling flaming garbage over the wall. The members of The Who hear about the area code problem and suggest that the townspeople get speed dial to resolve their differences. Pete Townshend's opening riff from "Won't Get Fooled Again" crumbles the wall, and the citizens of Springfield reunite and dance to the music. Meanwhile, the badger leads an animal invasion of the town to "get 'em while they're dancing".