Some kids or children will chew on their hair when they have autism, ADHD and sensory issues.
Although not every child who chews on their hair has any of those health issues and may just be chewing on their hair out of boredom or anxiety.
I used to chew on my hair as a child when I was bored such as at home or in class.
A child chewing on their hair can help them calm down and relax especially when they are nervous about something or they are just plain bored.
When a child is chewing on their hair it's usually not harmful unless they happen to ingest too much of it but if possible try to distract your child from chewing on their hair by doing something else.