What do cocoons do?

Solution 1:

Cocoons are for use of the clone larvae spell.

When you put larvae into a cocoon they can still be cloned, but they won't be used for transformation to other units. You can use cocoons to reserve the larvae for the cloning spell.

Clone larvae is limited to 100,000 times your larvae production per sec. So, cocoons are generally used to reserve this number of larvae to always use the clone spell to maximum effect without having to worry about spending too many larvae for transformation into adult units.