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 either shoot out several at once or start shooting them out more quickly. 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.
The Egg-Plant's name comes from the eggplant, a type of fruit. It also shares its name with a type of nightshade (hence the appearance).
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.
An Egg-Plant providing an egg for Mario.
An Egg-Plant appears in the Super Mario-Kun volume 14, where it helps Mario, Yoshi, and Luigi by providing eggs in their fight against Burt the Bashful.