If you have not been treating her for hairballs with a product like Laxatone or one of the many other ones then this might simply be the problem.
Cats swallow hair when they wash themselves and sometimes it balls up in the stomach and can't pass through. This makes them gag.
Alternatively if you are missing any string, a needle or a pin, or anything like one of her toys she might have something caught or swallowed that is really bothering her.
But the hairballs sound like the cat is almost dying as it gags graphically trying to get them up. If that is what it sounds like I'd try a hairball remedy first.
Hope this helps!
Please press Accept if you find my answer helpful. Want more info? Just reply on your question!
Bonuses for good work are always appreciated!
Thanks for the opportunity to help you!