Cappies are regular enemies in the Kirby series and have very important roles in the anime, Kirby: Right Back at Ya!, as well.
In Games
Kirby's Dream Land
Cappy made its first appearance in Kirby's Dream Land. If Kirby tries to inhale it, he will always suck in Cappy's mushroom cap first before being able to inhale Cappy itself.
Kirby's Adventure
Cappies has the same behavior like they had in Kirby's Dream Land.
Kirby Super Star
Cappy is a regular enemy and attacks by throwing its cap up the air.
Kirby: Nightmare in Dream Land
Same as Kirby's Adventure behavior.
Other Games
Cappy also appears in Kirby's Block Ball as a boss.
In the anime
Cappy appears as one of the most important roles in the whole anime as members of the Cappy Town.