It's likely your symptoms improved for both reasons. Damage to the soft tissues of the neck from injury, stress, or overuse takes about six weeks to recover. Exercise helps improve blood supply to areas trying to heal and repair.
When it comes to neck motion and function, a little pain reduction goes a long way. When you combine pain relief with improved activity, you feel much better physically and mentally.
Studies show that long-term outcomes are often the same between groups who exercise and those who don't. But most people agree they'd rather get pain relief sooner than later. Exercise is often the key to helping many parts of the body get back to normal.