Building strength does not increase your body’s intelligence. Chronic pain(including back pain and neck pain) is often caused by inefficient movement habits, not by weak muscles.
This could happen with any movement that you haven’t learned to do well enough: at the same time as performing the movement, you unconsciously do things that are actually counterproductive. This is usually experienced as a strain and often becomes accepted as a necessary part of the movement.
Unless you spend time learning to do a particular action better, strain gets integrated as a part of you habitual way to move and can easily go unnoticed, until something hurts. Pain comes because in addition to wasting energy, inefficient movement results in more wear and tear on muscles, tendons and joints. To alleviate this pain, you need to reduce this counterproductive effort and building strength does not help with that.