Do you have any other symptoms? Shortness of breath when exercising? Chest pains? Headaches?
Breathing can become disrupted by illness and/or stress, & the disruption can become self-sustaining. If that's the problem, it can be dealt with: in my case it was cured by breathing exercises (weeks of bloody hard work, but entirely effective) taught by a specialist respiratory physiotherapist*. The success rate for that treatment is very high.
If set off by anxiety, once it's started the attacks themselves can cause enough anxiety to trigger more attacks, & then you don't need any anxiety to keep them going because your body's been screwed up by the disrupted breathing . . .
*A keen cyclist, so she understood why I was keen to get back on my bike. Ditto for the consultant who sent me to her.