At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Maybe it means that the caterpillar is the one doing all the work for the transformation to take place for it to become a beautiful butterfly and they don't realize that a butterfly wasn't beautiful before.
The butterfly gets all the credit for the hard work the caterpillar has put in.
It's meant to be humorous. (As in this case the caterpillar and the butterfly are the same creature.)
Credit is given to the butterfly because of its beauty and the metaphors associated with the freedom it has once at the end of the coccooning process. It is not (necessarily) to imply that the caterpillar is ugly; but it is to say that there are many steps and much patient time involved for the caterpillar to evolve and gain its new found freedom.