The magic cap was an article of clothing created by the Two-headed Gonster for use in stopping the destructive forest creature known as the Raich. The cap was created using ingredients from a variety of animals including the hide of a wank and the ears of a dorg. However, the two-headed Gonster was never in agreement with itself about what exact ingredients it used for the original cap. In any case, the cap had the ability to transform the Raich into a harmless tree once it had been placed on its head.
However, for the cap to work its magic, it needed to be sprinkled with at least one handful of sparkleseeds which the Gonster provided to his Ewok charges. The Ewoks eventually were able to place the hat on the Raich's head, temporarily ending his destructive existence. Unfortunately, the Ewok Wicket Wystri Warrick eventually removed the magic cap, reanimating the creature. The Raich was able to get his claws on the hat and tear it to pieces so that he could not be imprisoned again.
Wicket and his friends Kneesaa a Jari Kintaka, Latara, and Teebo were forced to visit the Gonster in order to make a new cap, which he eventually agreed to after scolding Wicket for releasing the Raich. While Wicket and Kneesaa accepted a mission to put the Raich to sleep with Dreamflower Potion, Teebo and Latara stayed behind to help the Gonster make the new hat. After the cap's completion, the two young Ewoks reunited with Wicket and Kneesaa to get the cap onto the Raich's head. After initially forgetting the sparkleseeds, Teebo eventually added the handfuls of the seeds, and Wicket was able to place the cap back onto the Raich, ending the crisis.