Fear and panic are hard to understand. The assumption is that the same thinking-mind we're using now will be available if we're attacked. In fact, our memories are jumbled when we're frightened. Words escape us and we can't think clearly. That happens to us when we face a lethal threat. Fortunately, we remember how to act even though we forget how to think. That is why firearms and self-defense training is critically important. Let's contrast two recent example of armed self-defense.
An attack at home showed the benefit of a planned response, while an attack on the street showed the benefit of recent training. You only have the solutions you planned and practiced. .....
Opinion will always vary, but overall, retreat from a threat is the better option if viable. When that does not or cannot work, then this is where at least some degree of training can reduce the effects of potential panic and so mitigate the potential for ineffective response. Usually events happen fast and require split second decision making - just "having a gun" may well not be enough.