@futurebird With another kind of animal, I wouldn't have any idea. With a cat, I'm betting on game-playing.
Our cat Callista always starts swatting and snapping when petted. But she keeps right on purring the whole time! She isn't upset. She just thinks she has to swat and snap because that's what cats do.
@futurebird The solution if you want to get her to stop is counterintuitive: put your FACE next to her. Never once has she ever swatted or snapped at a face. Only hands. She's a rescue, and I suspect the asshats who abandoned her taught her that primate hands are cat toys.