Butterflies lay eggs on the food plant which is suited to the catterpillars of their species...eg....cabbage whites lay eggs on cabbages.........then the eggs hatch into catterpillars which after eating their eggshells start on the cabbages, much to the chagrin of the gardeners..........they then crawl away and find a spot to make a cocoon type thing where they morph into butterflies at the appropriate time, ie. when the next lot of cabbages are available...........other species have different food plants...........