One beautiful morning, Aladdin and Jasmine look out the window, searching for their next adventure. Aladdin suggests they let Carpet decide and, accompanied by Abu, they fly until the ground below starts to rumble and the Cave of Wonders emerges from the sand. Curious, they enter, despite Abu's reluctance, and find a familiar black lamp jumping and clattering around. The voice of the Cave orders them to remove it so it would no longer disturb his peace, to which Aladdin agrees, remembering what happened the last time they were there.
After bringing it back to the palace, Genie arrives and rubs the lamp, which unsurprisingly holds Jafar. Upon realizing that he is Jafar's master, Genie sees a chance to drive Jafar crazy by making him do good deeds. For his first wish, he sends Jafar into the marketplace to distribute food, money, and clothing among the poor children, who shower him with gratitude, much to nausea. For the second wish, Genie orders Jafar to feed and bathe all the animals in the royal menagerie. Upon completion, Genie lectures Jafar on what he'd learned about being a good guy throughout the whole process. After hearing his less-than-subtle response, Genie proposes an attitude adjustment.
For his final wish, Genie declares that Jafar will become a good guy someday when he least expects it. Furiously, Jafar goes back into his lamp as Genie throws it back to the Cave. Aladdin wonders if that last wish will ever come true, to which Genie replies that to some people it comes naturally, but in Jafar's case, maybe ten thousand years.