From the Super Mario Wiki
A Kamikaze Koopa is a type of Koopa Troopa found only in Super Mario World. It is created when a yellow Beach Koopa climbs into an empty Koopa Shell of any color, including its own after being ejected from it. It becomes invincible with its shell flashing rainbow colors, thus becoming a Kamikaze Koopa. After its transformation, the Kamikaze Koopa attempts to hit Mario or Luigi by spinning around in its shell and dashing towards them. It becomes impossible to separate the Beach Koopa from the shell.
Jumping on a Kamikaze Koopa causes the Mario Bros. to bounce upwards, but does not damage the shell. They can only be defeated with a Yoshi, a Spin Jump or a Star. If any Yoshi eats one, it obtains all three shell abilities (causing small earthquakes, flying, and spitting out fire) as long as the shell remains in its mouth.
After beating the Special World (or completing all 96 exits in the Game Boy Advance version), all Koopa Troopa and Paratroopa shells become Mario masks. Kamikaze Koopas thus become spinning, flashing Mario masks.