Experts admit that they are not always sure what causes a habit, but they know it is a learned behavior that usually provides a positive experience for the child. Habits may develop as entertainment for a bored child, or as a coping mechanism to soothe an anxious one. Biting nails or twirling hair might be one way a child relieves tension, just as a parent might try to relax by having a cocktail or exercising.
Most habits eventually disappear. Often if a parent ignores a habit, the behavior will eventually stop when the child no longer needs it or outgrows it. Many habits, in fact, do disappear when a child reaches school age.