The human brain is the most complicated structure on Earth. 86 billion electrically conducting cells all linked up in a chemical network with up to 100 trillion connections. So, as with all brain-related questions, the answer to "what causes X" is still a mystery. Particularly when it comes to emotions and feelings.
What we do know is that certain mental activities seem to take place in certain brain regions. What I mean by that is that when we monitor a human brain experiencing a particular emotion or undergoing a particular task, we can monitor how much electrical activity is taking place in the brain and we discover that certain regions match certain thought processes.
The chemicals which move in between the brain cells (telling them to conduct or not) are called neurotransmitters and they also play a significant role of some sort. Oxytocin, for instance, is a neurotransmitter which gets released/manufactured a lot when a person is in love. We don't know what the cause-effect relationship is though. Does seeing a person we fancy trigger an oxytocin release in the brain? Or does oxytocin get released in the brain at random, telling us that we fancy a certain person?
To make things more confusing there are only a few dozen neurotransmitters which get used but obviously there are way more emotional states or thought processes available to us. What do we make of that "Sunday afternoon feeling" or "the feeling of being jealous of our best friend" etc. etc.
In short, we don't know how thinking works and how emotions are processed. What we do know is that when these chemicals get imbalanced in the brain it can cause psychiatric illness and that, for some people at least, taking medications to restore the correct ratios of these neurotransmitters can restore the person's mental health.
Anxiety seems to be associated with an imbalance of four chemicals in particular: serotonin, dopamine (two neurotransmitters) cortisol and adrenaline (two hormones). Cortisol is the "stress" hormone, a chemical in the blood which rises when you're doing tasks your body isn't built to take for too long, it's like a warning system for your organs to slow down.
Adrenaline is the "fight/flight/play dead" hormone that gets you ready for challenge. Serotonin is the "happiness" neurotransmitter which gets produced when you are experiencing contented happiness. Dopamine is the "energetic bring on the world" neurotransmitter which generates feelings of excited confidence and thrill.
Serotonin is more the "relaxing comfortably on a beach chair" neurotransmitter while dopamine is the "at a gig rocking out to music" neurotransmitter. Although obviously the two are closely linked and they can impact each other's production/release.
The brain regions most involved in anxiety seem to be the amygdala and hippocampus - the brain's emotional centres. As I said earlier though, at the deepest level nobody knows how thought works so nobody really knows WHY serotonin is associated with happiness. We don't know whether being happy causes serotonin to be released leading you to act/think a certain way or whether serotonin release triggers "happiness emotions". The ins and outs are insanely complicated but the approximate gist seems to be something along the following lines:
If serotonin get too low the person suffers depression, obsessive compulsive disorder or eating disorders.
If dopamine gets too high the person suffers psychosis/delusions and possibly schizotypal symptoms.
If cortisol gets too high the person suffers from stress.
If adrenaline gets too high a lot of different things can happen ranging from heightened bloodpressure to an unusual condition where your skin changes colour.
Anxiety seems to be a combined imbalance of these four chemicals. If the serotonin gets too low, but the dopamine and cortisol get high at the same time with a little bit of adrenaline, the result is anxiety, sometimes mixed with depression. Sometimes this can be triggered by certain things (phobias), sometimes they are at a constantly mis-matched level (anxious personality) and sometimes they just go haywire (panic attacks).
Panic attacks are rather unfortunately named because they often have nothing to do with panicking. A person can be sitting on a hillside looking at an apple tree and suddenly get a crushing pain in the chest, hyperventilation, dizziness, vomiting, crying, hot and cold flushes and headaches all out of nowhere.
For sufferers of "panic attacks" it feels as though they are about to die, which is what the body thinks is about to happen. You get the same kinds of effects on the body and brain that a person would experience being locked in a room with a tiger. It's not the person worrying about something, it appears to be a biochemical illness they have little conscious control over. Granted, the overall cause can sometimes be stress, but people who suffer these attacks don't need to be told "calm down" because they physically aren't capable of it.
The good news is that panic attacks, while indescribably horrible, pose no actual danger to the victim. It's sort of like your body's burglar alarm system going off by accident. All the symptoms and warning signs are there, but the person is completely safe.
As to curing anxiety and panic attacks, the answer is that different things seem to work for different people. For some people medication is the answer, for others it's meditation. For some psychotherapy helps, for others it could be a change of job. So the short answer is that as yet, we only have a half-answer. But the same is true for pretty much any emotion or feeling. The brain is just too darn complex.