um... well we know that it works without Pikmin in it. We also know that Pikmin have flowers - which are reproductive organs. Plus, we know that the onion requires food in various forms.
It seems that the onion is likely the female form of Pikmin. I'd guess that the flowers on the male Pikmin pollinate the interior organs of the onion at night, and that the food provides extra energy to the incubating seeds, allowing them to be released.