I really liked Jack Aidley and L.Dutch's answers. However, I just wanted to add one more possibility: quorum sensing, whereby certain behavior is triggered by the density of a certain external stimulus.
In the case of the Crashfish, each fish constantly
poops releases a hormone in the surrounding water, a bit like humans may release chemicals perceived as body odor by others. When the local concentration of the hormone in the water becomes higher than a certain threshold, the fish triggers a hormone response called the self-ignition response, enabling the explosive behavior. The explosion clears the local area from the hormone, thus having a "sedative" effects on the nearest Crashfishes.
In practice, if the colony is too successful, then there will be more hormone in the water, and there will be more explosions, taking down the population number. If the colony is not particularly successful, it may happen that no crashfish will blow itself up.
Hiding in the plant may just be a intermediate response to high hormone concentration, whereby the fish tries to find an area, by instinct hiding in the plant, with reduced hormone concentration before triggering the self-ignition capability.