Its the most common reason. It also happens to people who get fades as haircuts. The act of shaving up against the hair pushes it back into the skin. The same thing happens when shaving against the grain.
It goes away I think (never had one) but sometimes it can be bad to the point where it needs to be cut open and it doesn't go away. My father had one on the back of his neck, its not cool

It needed to be cut open by a doctor and drained, apparently it can fill up with fluids