Ads keep the MarioWiki independent and free :)
The three power-up caps in Super Mario 64 give Mario certain special abilities:
Mario's Cap can be stolen by Klepto and Ukiki, or blown away by a Fwoosh or the giant Snowman in Snowman's Land. When Mario loses possession of his cap, he takes twice as much damage when hit by an enemy. When lost, Mario's Cap can be found by defeating enemies that wear it.
In Super Mario 64 DS, the various characters' caps appear instead and serve a new function. Grabbing a cap allows whomever possesses it to change his appearance and abilities (however, his voice will remain unchanged). If a character (besides Yoshi) loses his cap, Bob-ombs will pop out of ? Blocks instead of power-ups, in addition to the original game's defense penalty. In the early portion of the game, those kinds of caps also act as 1-Up Mushrooms. For example, if Yoshi wears Mario's Cap and takes another one, he will be awarded with a 1-Up. However, as Yoshi frees Bowser's three captive prisoners, more caps will appear and it will be impossible to find two caps of the same color. Yoshi can choose to wear the caps of whatever characters were rescued before entering a course.
In Super Mario Sunshine, the Swipin' Stu enemy can steal the Mario Cap. If Mario does not get back his cap, his energy will slowly drain until he dies, due to it being so hot (standing in the shade has no effect). Along with wearing his cap, it gains a Mario-esque mustache.
In Super Mario Odyssey, Cappy can take the forms of many different caps that Mario can wear. These caps can be thrown to hit blocks and enemies, capture certain characters or objects, and be used as a temporary jumping platform for Mario (among other uses). All caps are aesthetic and have identical abilities (excluding access to certain areas).