Neck pain is a very common problem. Neck pain is also not all that different to, for example, knee pain. If you have knee pain you might not use it as normally by not squatting as often. This in turn can lead to the muscles around your knee weakening. Weak knee muscles can then cause your knee to keep getting painful because more stress and strain goes onto the knee joint. Strengthening those knee/leg muscles will often help the knee pain.
The neck is no different. Large amounts of research conclusively show that changes in structure and function of neck muscles occurs as a result of neck pain (see here for a nice start point for those wanting more specific research information). In essence what these changes result in is weakness in the muscles that support the neck. Now your neck is not going to fall off but, as I am sure you can imagine, weak muscles around the neck are going to potentially make the joints, nerves and other structures around your neck more likely to get sore.
So if you have ongoing neck pain, neck stiffness and/or headaches you will most likely benefit from a physiotherapy assessment to identify if you have weak neck muscles (you probably will). The physiotherapist can then provide you with an exercise program to strengthen those muscles!