Cool question! Believe it or not, a large portion of the caterpillar’s body are intestines so plenty of room to store food. Besides, they’ve got a tough job ahead of them. After a little while (about 3 weeks) of eating non-stop, they use all of this energy to build a cocoon and turn into butterflies! Now this whole process is very energy intensive because it involves literally restructuring their entire body. All this energy goes towards digesting most of the caterpillar’s organs, except for a few specialized structures. And then these specialized structures literally divide into more cells, use the energy from its former body and become beautiful butterflies!
Although caterpillar’s may be tiny, they need to eat a lot to store all their energy for becoming butterflies!