In a sense, this is a circular question, because fear and panic are in themselves irrational, or at least rooted in that hyperemotional side of human nature that prevents the mind from exercising reason. So, the query can be rephrased as, "What causes fear and panic?"
Even if irrational, those emotional responses are inevitable when violent acts occur, especially when a country is attacked. In such cases, people feel that something, anything, must be done in response, even if it's not very well thought-out. For instance, after the 9/11 attacks, there was no way of knowing that further and possibly worse attacks were not going to be made against the US by terrorists. It was understandable that the US administration responded by bombing the terrorist training camps in Afghanistan. Yet destroying the camps wasn't thought to be enough. A campaign of nation-building was initiated in Afghanistan, and a year and a half later, the administration extended the war into Iraq, though there was no evidence Iraq had had anything to do with the 9/11 attacks.
Many Americans genuinely feared that terrorists could obtain nuclear or other "weapons of mass destruction" and literally wipe them out. It is, and has been throughout history in other places and situations, chiefly this sense that one's country and people might be obliterated that has caused irrational reactions and responses—sometimes misplaced and self-defeating ones.