The skin that flanks yout nails grows out aith your nails, only more slowly, and the further from the nail the more slowly yet. You can follow that process if ever you get the point of a thorn or some other visible injury in that skin.
Because the layers of skin differ in their growth rate, the collagen fibres in that area of the skin easily separate, especially if the skin is damaged by biting, drying or similar bad conditions. A little area of the hard skin separates alongside the nail, and sometimes it can be quite painful. It certainly can be a nuisance, catching in fibres and so on. It remains there until it grows past the end of the nail, which can take many months, or until it is trimmed.
If you do not trim or pull it off properly, the soft tissue it exposes is likely to become painful and may be infected as well, which can have serious consequences.
Most people can avoid hangnails by keeping their skin properly moisturised or lubricated, and by avoiding damage by nailbiting or manual work without protection, such as suitable gloves.
Once a hangnail appears, it may be necessary to trim it. The most important thing is not to peel it back against the grain; that almost invariably follows the grain and deepens the injury. It is painful and generally causes infection.
There are two approaches. If you have the tools, you can pull the hangnail towards the free end of the nail till it breaks off without peeling. It must not peel! When it snaps off, antiseptic ointment should be applied. If it is properly done this should get rid of the problem cleanly and quickly, but it is the risky approach.
The usual, safer approach is to trim the hangnail back as short and smoothly as possible with small, sharp nail clippers. The problem is that if you cannot get it trimmed smoothly, you simply are left with a smaller hangnail.