It depends. For some girls, it's a habit, a distraction, or something they do when their nervous. For example, if I'm talking to a guy I like I play with my hair because I'm nervous. :P lol. Hope this helped.
For me half the time I don't even realize I'm doing it. I do it a lot like in class and things like that because I'm bored, and sometimes when I'm nervous or uncomfortable because I don't know what else to do