Nail biting is a nervous mannerism which becomes a habit. These are problems which tend to disappear or gradually decrease as the child grows older like thumb sucking.
These habits are fairly common in young children but do not indicate serious disturbance. Children who suck thumb or nail bite often do it when they are bored and have nothing to do or when they are anxious. They find it soothing to do.
However it is an indication of a deeper problem if it becomes a social or a work functioning problem .There may be a genetic factor as it is more prevalent among children whose parents were nail biters even when parents were no more into this habit even when their children were born.
It could also be related to OCD as the child is aware of what he/she is doing but does not have control over it. Also putting nails in the mouth is an unsanitary practice and thus increases the risk of introducing germs into your system
An age old practice is to apply bitter solutions onto the fingers so that the child feels unpleasant when he/she puts fingers into the mouth. However in some cases it works but in many cases it has failed.