The onions are Pikmin incubators and vehicles introduced in beginning of the first Pikmin, named by Olimar for their onion-like shape. When these are first discovered, they are pale and half buried, but suddenly spring back to life upon closer inspection, extending their legs and releasing a single Pikmin Seed. They will release more seeds when Pellets or other dead enemies are brought to it by the Pikmin. If there are already 100 Pikmin in the field, additional Pikmin seeds will grow inside the onion instead of being ejected. If all Pikmin in the game are wiped out by Hazards or enemies, the onion will eject another single seed.
Onions come in three different colors: Red, Yellow and Blue, which release and house Pikmin of the corresponding color only. To call out or put back Pikmin, stand in the beam under an onion and press the A button. You can then see how many Pikmin are in and the onion and how many of that specific color are in your party. Most importantly, you can also choose the amount of Pikmin to call out or put back with the control stick, and then confirm the selection with A.
At the end of every day, the onions will retract their legs and use their flower-propellers to follow Olimar up into low orbit around the Pikmin Planet. They will also land with him in the morning in the Area that you choose. It is not known whether the onions are creatures or machines, or even a hybrid, like the Gatling Groink.
 Super Smash Bros. Brawl
In Super Smash Bros. Brawl, the onions (along with several Pellet Posies and a gigantic Red Bulborb) can be found in the Distant Planet stage. One will occasionally fly down from the top of the screen and land on one of the three raised leaves. If a Pellet Posy pops up, you can attack it and throw it into the onion to recieve a random item. Attack the onions excessively will cause them to leave. They will also leave by themselves after a little while.
"Items considered to be the places where Pikmin are born. As to the actual biology of the process, much is still unclear. Onions absorb the prey that Pikmin capture and use it to produce new Pikmin. In addition, Onions can take in Pikmin and later release them. These organisms are crowned with distinctive propeller-like sets of leaves that spin around, enabling them to fly."
Related ThreadsWhite/Purple Onions? - last post by @ Jul 27, 2013
Question about Onions - last post by @ Jun 27, 2008
new idea for an onion - last post by @ Oct 27, 2007
Onion - last post by @ Mar 24, 2005
Onion - last post by @ Mar 28, 2005