In my work as a analytical psychotherapist, I encounter quite a few people who struggle with panic attacks. What becomes clear pretty quickly is that some of these individuals tend to be very, very angry. However, they are not aware of their anger, and what transpires later is that they are also very frightened by their anger. It seems that they have not been able to differentiate their own angry thoughts from actions, so they are afraid if they allow themselves to become aware of their anger, and to allow it to come into their mind, somehow people around them will get hurt. We might understand this way of thinking as 'magical thinking'.
These individuals have not been able to grasp that fantasies, feelings and emotions are merely the contents of the mind. In their minds these thoughts have magical power to harm people. Therefore, this means there is little alternative but to bottle them up, and repress them. Freud's basic discovery was that the repressed returns in disguised forms. It is my opinion that repressed anger or painful emotions often returns in the form of panic attacks. It is as if the person feels that their anger is coming very close to the surface, that a volcano is close to erupting and they become terrified in the face of this threatening eruption.
Another source for this anger is trauma. It's extremely angering to be traumatised and highly frustrating. Frustration generally leads to aggression. One group of psychologists called this the frustration/aggression hypothesis. In my opinion frustration and trauma produces anger and so traumatised individuals are often very angry individuals. However, from my experience these individuals don't want to be angry and don't want to know that they are angry for the reasons cited. As a result, when their anger is close to erupting they have a panic attack. I'm not saying that all panic attacks boil down to this, but I think this is often part of the picture.
The goal for people who suffer from panic attacks is to integrate/understand these threatening fantasies, feelings and emotions. The outcome being that an individuals ego strength develops and becomes more resilient in dealing with situations that may have triggered the panic attacks previously. A good analogy to help explain this point further is this; a teacher represents our ego functioning and a class represents our internal world of fantasies, feelings and emotions. When a person experiences a panic attack, the ego strength (teacher) becomes overrun by it's unruly internal world (class). Therapy is a kin to having a classroom assistant who assists the overwhelmed teacher (ego). The aim being to become more contained until the ego teacher is strong enough to mange their class (internal world) on their own.
Volcanoes stop erupting because all the trapped volatile gases have degassed and there is no longer sufficient pressure to drive the magma out of the earth (Annenberg Foundation 2015). Equally, panic attacks will stop erupting once the pressure of threatening emotions have been understood and integrated.