Warning: Wikipedia contains spoilers.
Dorothy has risen from bed for the day and is seeing to her friends in the Emerald City and notices that Ozma hasn't awakened yet. Ozma's chambermaid doesn't dare disturb her, but Dorothy, as a Princess of Oz, goes into Ozma's chambers only to find she's not there. She's nowhere in the palace either, and when they want to find out where she is, the Magic Picture which could reveal that is gone as well.
Glinda awakens in her palace in the Quadling Country and finds her Great Book of Records is missing; it's been cut from the podium it's chained to. She goes to prepare a magic spell to find where it is only to find all of her magic tools are gone as well. She dispatches a messenger to the Emerald City to relay news of the theft, and the Wizard offers his magic tools to assist Glinda, only to find them missing as well. Glinda, Dorothy, and the Wizard organize search parties to find Ozma and the missing magic. Dorothy and the Wizard's party heads into the Winkie Country to the west of the Emerald City.
Concurrently, another theft took place during the night. In the southwestern corner of the Winkie Country on a plateau live the Yips, and Cayke the Cookie Cook has had her diamond-studded gold dishpan stolen. The advisor to the Yips, a human-sized dandy of a frog called the Frogman, hears Cayke's story and offers to help her find the dishpan. He's only the Yips' advisor because he's puffed himself up—he's really no wiser than any of them. When they've gotten down the mountain, Cayke reveals to the Frogman that the dishpan has magic powers, for her cookies come out perfect every time.
Dorothy, the Wizard, and their party jump over the spinning Merry-Go-Round Mountains and enter the previously unknown communities of Thi and Herku. The citizens of Thi are ruled by the High Coco-Lorum (really the King, but the people don't know it) and repeat the same story about the Herkus: they keep giants for their slaves. In the Great Orchard between Thi and Herku, the party enjoys a variety of fruits, and Button-Bright (who's gotten lost again) eats from the one peach tree in the orchard, unusual because the peach's pit is gold. Button-Bright pockets the gold peach pit to show Dorothy, Betsy, and Trot later despite warnings from the local animals (which like all animals in Oz can talk) that Ugu the Shoemaker enchanted it.
In the city of Herku, Dorothy and the Wizard's party are greeted by the emaciated, friendly Czarover of Herku, who invented a pure energy compound called zosozo that made him and all his people superhumanly strong and also extremely thin—strong enough to keep giants as slaves. The Czarover offers them six doses to use in their travels and casually reveals that Ugu the Shoemaker came from Herku. He found magic books in his attic one day because he was descended from the greatest enchanter ever known and learned over time to do a great many magical things. Ugu moved from Herku and built a castle high in the mountains, and that description stirs Dorothy and the Wizard to think that he might be behind all the recent thefts of magic and the ruler of Oz. They proceed from Herku toward the castle and meet with the Frogman, Cayke the Cookie Cook, and the Lavender Bear, the stuffed bear who rules Bear Center. With him he carries the Little Pink Bear, a small wind-up toy that can answer any question about the past put to it.
When the combined party arrives at Ugu's castle, Button-Bright gets separated from them and falls into a pit. Before they rescue him, the Wizard asks the Little Pink Bear where Ozma is and it says that she's in the pit too! After Button-Bright is let out of the pit, the Little Pink Bear says that she's there among the party. Unsure what to make of this seeming contradiction, the party advances toward the castle and overcomes several magical defenses (primarily tricks he stole from Glinda and the Wizard) before meeting Ugu himself.
Ugu uses magic to start the whole room spinning and retreats from the scene. Dorothy stops it by making a wish with the Magic Belt, a source of magic Ugu knew nothing about because the Belt did not originate in Oz. She uses its power to turn Ugu into a dove, but he modifies the enchantment so he retains human size and aggressive nature. Fighting his way past Dorothy and her companions, Ugu the dove uses Cayke's diamond-studded dishpan—which can magically transport its user to anyplace in Oz instantly—to flee to the Quadling Country, where the dishpan is picked up by the Scarecrow and the Tin Woodman who are searching there.
Once the magic tools are recovered, the conquering search party turns their attention to finding Ozma. The Little Pink Bear reveals that Ozma is being carried in Button-Bright's jacket pocket, where he placed the gold peach pit. The Wizard opens it with a knife, and Ozma is released from where Ugu had imprisoned her. She was kidnapped by Ugu when she came upon him stealing her and the Wizard's magic instruments.
The people of the Emerald City and Ozma's friends all celebrate her return. Days later, the transformed Ugu flies in to see Dorothy and ask her forgiveness for what he did. She offers it and offers to change him back with the Magic Belt, but Ugu's decided that he likes being a dove much better.