From the Super Mario Wiki
Egg-Plants are flowers that are found in Super Mario World 2: Yoshi's Island, Yoshi's Island: Super Mario Advance 3 and Yoshi's Island DS. These flowers normally spit out normal Yoshi Eggs. They are very common and appear in almost every level. They spit out Yoshi Eggs one at a time, but if a Yoshi Ground Pounds near one, the plant will shoot out several at once. The Yoshi can also lick the eggs to catch them. Since the Yoshi can only carry six eggs each, the Egg-Plant won't produce more eggs anymore until the Yoshi uses one of the Yoshi Eggs on something.
Also, some Egg-Plants will spit out Needlenoses, but as long as a Yoshi has six eggs, it can't spit any out. There are four Needlenose-spitting Egg-Plants in the Island Museum. They can be viewed in the botanical enemy exhibit.