Judy and Peter fight over who gets the last cookie; Peter decides to enlist Alan's help and gets the clue "the river is long, the river is wide, you'll keep looking till you've found the right side." They arrive in Alan's cave during a storm and try to drag him into their argument, but a flash flood washes them out of the cave. After the storm ends, they try to figure out which is the "right" side of the river, but are forced to land to escape a waterfall. They land and are caught up in a war between black and red ants; Peter is captured by the red. Peter is taken to the Queen of the Red Ants who thinks he's a spy, but he convinces her he's not with the help of the ant who captured him who believes him. The red queen dispatches some soldiers to find Judy and Alan, but keeps Peter with her. The black ants reveal they hate the red ants because they stole their Black Bahoot which the black ant who found Judy and Alan says words can't describe. Meanwhile the Red Queen reveals to Peter that she despises the black ants and claims that they want to steal the red ants Red Bahoot and call it their own. She shows it to Peter and it turns out to be a disgusting object that the ants seem to think is majestic. Alan gives the Black Ants plans for catapults to defeat the Red Ants as he believes its their only hope of saving Peter, but Judy's very reluctant as they know so little about the feud between the ants. At the Red Ants camp, Peter gives them mechanical crossbows to give them an edge over the Black Ants. The Black Ants plan an attack on the Red Ants and plan to leave no trace of them behind, which horrifies Judy and Alan as Peter might get killed in the process The two sneak into the Red Anthill to rescue Peter but he refuses to go as he believes the Red Ants are great so they decide to kidnap him but are captured. Peter claims they're spies for the Red Ants and warns the Queen of the attack so she has Alan and Judy thrown into the dungeon while they prepare for battle. The battle begins and after Peter's ant friend is killed by a catapult, he steals the Bahoot and frees Alan and Judy to try to stop the battle. They use the Bahoot to get the ants attention then lead them to the river. Despite them threatening to throw the Bahoot in, the ants refuse to make peace so Peter throws the Bahoot into the river. The ants are so outraged they unite to try to kill Peter, Alan and Judy who jump into the river and escape. Later as they float on a log, they realize the clue meant the war and there was no right side; this solves the clue and sends Judy and Peter home. At home the two wonder if the ants will ever stop their war but doubt it. They remember the last cookie and resume their own war for it.