The gut is expanded. Haemolymph is pumped to a particular part of the body, usually the thorax, which expands it and greatly increases the size of the body in that area. The old cuticle splits down the line of weakness and the insect pulls itself out of the old skin. The new skin then expands as the insect swallows more air or water. Expansion comes from deep folds in the new cuticle inside the insect and from the flattening of wrinkles.
Membranous areas remain untanned, and thus are able to flex and move more readily.
The tanning is regulated by epidermal cells beneath the cuticle.