A 5 year old child or any child chewing on their shirt is likely doing so because of the need for oral fixation or your child could simply be nervous, bored etc and just want something to do.
I used to chew my shirt when I was a kid because I was nervous a lot and had severe anxiety.
It's not always an indication of a health issue if your child is chewing their shirt and it's not gonna harm them.
Your child or 5 year old could also be a sensory sensitive child and when they feel embarrassed or shy or overwhelmed as a way of calming down their central nervous system or releasing some of the emotion they are feeling so they chew on their shirt or other objects.
They might also just like the texture of the shirt in their mouth as well.