My sibling had a terrible habit of nail biting and here's what i've learned form her:
Nail biting can also be caused by:
Stress and anxiety - It can be a way of releasing stress and anxiety because it feels good.
Boredom and frustration - Nail biting can also be a way of doing something instead of nothing when bored or frustrate.
Mental health disorders - It can also be associated with some mental health conditions, such as ADHD, OCD, depression, and Tourette’s syndrome.
Genetics. Nail biting can be inherited from parents
There can be many physical remedies like applying homemade bitter nail polish, cutting nails short, etc. but dealing with internal causes helps get rid of it faster and forever.