I am not sure what you mean with insects stiffening when they die but I can explain why they curl up on their backs. It is not 100% proven but it is thought that when an insect is dead or dying, it cannot keep it’s limbs under enough tension so it goes into a “state of relaxation”. That is why the legs curl up.
Another possibility is that without blood flow to the limbs, the muscles contract and fold up.
Latest Answers