It could be a reaction to the emotions - I used to bite my nails due to anxiety and sometimes fear. I wouldn't always be conscious of it but would do it to the point they would bleed. It is slightly different to intentional self-injury but the reasons behind it and triggers are often very similar.
There are ways to start to overcome it if you are interested. It does take time and a lot of work since you first need to become more conscious of the reasons behind it and how to manage it, but it is possible to overcome