What does a pain in the back of the neck means?

Many reasons. Can be muscular, disc related, sleeping incorrectly, posture not straight.? Pain radiates? Pain stays in same location? Numbness? When does the pain occurr? You shoiuld see primary md, obtain x rays and exam as this is too vague to delineate via the internet.
Variety of reasons. This can be related to muscle strain, bony damage, or a variety of reasons. Your question is too general.