In really old-school Chinese dramas I've seen, female characters would hold things in their mouth to show their frustration. It could be their own hair, a stalk of flower, her handkerchief, etc.
Yeah it can be a visual device to convey and express things to the audience.
For comics, that could be a visual comedy.
For movies, that could be to avoid to explicitly relay emotions with explicit thoughts that would sound unconvincing.
For books, it'd be a show, don't tell thing, and to anchor the female character in specificity. Like how some writers would describe in detail how a character is stiffening, eyes popped open and screaming than just telling the character is terrorized.
Thus, could anyone explain what this is about? Like how did artists/authors/whatever decide that was to go to action for this representation?
Chewing hair is likely a quirk that the author just decided for that female character. And as other pointed out, chewing stuff is a common soothing habit, so it's not totally unconvincing.
Since quirks are irrational, there's no need for author to think hard on justifications. But it's preferable to choose quirks that are related to personality, history or theme. For instance, a character could fiddle an old injury when nervous (like perceived as a source of shame/vulnerability while implying a rich background story)