In perhaps as many as 60 per cent of all insect species a worm-like larva transforms into a more distinctive adult.
So a larval stage must have some evolutionary advantage. It might be that larvae, many of whom burrow, can live in environments where predators struggle to co-exist, or that a mobile larva that can find its own food gets more nutrition than if it had to rely on the finite energy supply of an egg.
Source: How did insects’ larval stage evolve? | Discover Wildlife