From the Super Mario Wiki
Coin Bandits are salmon-colored enemies that appear in Super Mario World 2: Yoshi's Island. Their name comes from the Red Coin that they sport above their heads. These enemies run away from Yoshi on sight, but if Yoshi gets the coin from them, their behavior then reverts to that of normal Bandits. There is a glitch that if Yoshi grabs the coin without touching the Coin Bandit, it will act as if it was still holding the coin.