Pellets and crystalized nectar are used for onions to create more Pikmin, depending on The size of the pellet or crystalized nectar is the amount of Pikmin you´ll get from them

Raw crystallized nectar is more common and easier to amass. When a Pikmin deals the final blow to any mob, there´s a high chance they´ll drop crystallized nectar, the more max hp the killed mob has, the more and bigger nectar you´ll get, to be specific, first you get 1 big crystalized nectar for every 16 hp the mob had, and of what if left, you´ll get 1 small nectar for every 4 hp, bug nectar produces 2 seeds, while you need 2 small ones to even produce 1 seed, basically, you´ll get half a seed for every 4 max hp the mob had.

An alternative to this are pellets, which grow from pellet posies, which have their own section in this guide, what is important is that each one produces 1 or 5 seeds when consumed by an onion, depending on the number they show, the issue is, onions can only consume pellets of the same color, and can only be harvested by Pikmin of their same color.

Being that you either use pellets or crystalized nectar, you´ll need to have at least 1 Pikmin alive to produce more, but there are two last options if you lose all your Pikmin.

-First, onions can absorb dormant onions of the same color, this will give you a bunch of seeds but is not really worth it as a consistent source of Pikmin seeds since onions aren´t that common

-Second, onions can absorb and eat wardens, being blind and made of whatever weird biomass sculk is they are ironically an easy-to-get and process source of resources for onions who can just "eat" them alive, they´ll also get a bunch of seeds so in a pinch you can try a trip to the deep dark recover your numbers, or even make a farm them if you consider skilled enough.