It scatters toxic spores from the mushroom cap. In China, the spores are used as herbal medicine.
The bug host is drained of energy by the mushrooms on its back. They appear to do all the thinking.