Are caterpillars a friend or a foe to the plants?

foe to the plants