Caterpillars turn into moths because that's their purpose. A moth caterpillar is essentially a baby moth. They have one job and that is to eat as much as possible in order to become a moth.