When you go underground into caves, the Ship dispatches its upper half, known as the Research Pod, and sends it down to support Olimar & Louie on their underground expedition. Anything that the Pikmin pick up will be carried to the pod and stored in its hull until you exit the cavern. If you lose all of your Pikmin or both captains have been defeated, it will empty itself of all cargo and take in Olimar and Louie and go back to the surface; should this happen you'll lose any carcasses, treasures, and the pikmin that were with you.