The bug host is drained of energy by the mushrooms on its back. They appear to do all the thinking.
When nothing's left to extract from the bug, the mushrooms on its back leave spores on the bug's egg.