I was taught that caterpillars occupy a different ecological nishe compared with adult butterflies: they live in different place and eat different food. So, there is no competition between young and old members of the same species. Other invertebrates like parasitic worms also often have very complicated life cycles, with one stage living freely in the water, another stage living as a parasite in mollusks, the third as a parasite in cattle and so on.