It scatters toxic spores from the mushroom cap. In China, the spores are used as herbal medicine.
It stays mostly in dark, damp places, the preference not of the bug, but of the big mush rooms on its back.