Couple of answers
There are a couple of things that can go on with neck cracking.
One is that the tendons of the muscles of the neck snap over each other and the other is that the joints of the neck called facet joints can produce a popping sound as well. Neck cracking during regular movement is very common and benign. I do not advocate people violently cracking their neck by forcefully twisting their neck.