People usually respond with irrational fear and panic when they are facing something they cannot understand or control. Most of us like to be in control over our lives, or at least think we are. The same is true of people as a whole in society. When faced with a situation that is beyond control or understanding, society as a whole plunges into panic and seems to lose its collective reason.
Arthur Miller's play The Crucible presents this dynamic in detail. Things are happening in Salem that people do not understand and cannot control. Young girls are dabbling in witchcraft and seem to be possessed. Then they seem to be possessing and tormenting others. The situation quickly escalates as town officials and judges add to the panic by their attempts to control a situation that rapidly gets out of hand. Their interference only adds to the confusion and increases the panic, as it gives legitimacy to the girls' accusations.
What's more, there is a whole set of resentments lurking beneath the surface that contributes to the panic. People envy their neighbors and want something their neighbors have (like land or even a spouse). They cannot get those things. They cannot control their situations or make others do what they want, so they try another way. They begin accusing their neighbors to promote their ulterior motives. The fear and panic only rise higher with this manipulation.
Eventually, in Salem, people die, executed for witchcraft based on the unproven charges of some young women and on the fear and panic of a community that cannot control or understand the situation.