From the Super Mario Wiki
Swallow is one of Yoshi's most common moves. After catching an enemy with his tongue and swallowing, Yoshi can turn it into a Yoshi Egg. He can also spit them back out, which will defeat another enemy upon contact. In the Super Smash Bros. series, such move is called Egg Lay.
It is also used to eat fruit in Super Mario Sunshine to refuel Yoshi's stomach. The color of the juice is determined by what fruit is eaten. Yoshi also eats fruit in other games, such as: Super Mario World and New Super Mario Bros. Wii. In Super Mario World, when a Baby Yoshi eats five fruits, it becomes a big Yoshi, whereas in New Super Mario Bros. Wii, 5 fruits gives the player a Powerup.
Swallow is also an alternate name for Kirby's Inhale special move in Super Smash Bros. and Super Smash Bros. Melee. It is Kirby's most important move. Without it, Kirby would not be able to shoot stars and use special abilities.