Yes, in many cases they are an improvement, but not always. Every "best practice" must be judged individually with the question "does it apply here?".
Years ago I was working with some very small piece of a web-crawling framework, and I had to do something special for www.naver.com, Korea's biggest portal. Because the string "www.naver.com" appeared multiple times in the same function, we put that into a string constant at the beginning: something like
static const string kNaverUrl = "www.naver.com";
Because having "magic constant" sprinkled in the code is bad!...it was only much later that I realized the stupidity. As if Naver, Korea's #1 portal, will change its domain name at a whim! Even in the unlikely case that happens (say, they get acquired), so many other things will also change that my code will be surely unusable after that.
kNaverUrl was an unnecessary detour that only served to make the code longer and (slightly) less obvious, guarding against a theoretical possibility that will never come true.
Code Review has this nasty tendency of accumulating "best practices" beyond breaking point, because nobody objects to best practices. Once in a while, these practices turn out not to be that best.
Just my two cents.
It also defends against typos, as serge2k pointed.
kNaverUrl('index.html')
Multiple functions: kNaverWwwUrl('index.html')
kNaverApiUrl('resource')
Then it get's refactored: urlGenerator('www.naver.com')('index.html')
urlGenerator('api.naver.com')('resource')
Refactored even more: urlFor('naver_www', 'index.html')
urlFor('naver_api', 'resource')
Even more! urlGeneratorFactoryFactory(.......You have changed your magic string into a magic constant. It's a step towards better code, but the next step is to give the thing a proper name. In this case, something like DoSomethingSpecialUrl. Now you have a bit of self-documenting code.
Maybe they won't change their domain name, but what if you end up needing to move from http to https? Or what if you want to crawl their staging server at staging.naver.com? Or if you wanted to bypass the DNS?
Avoiding the magic constant achieves more than just guarding against name changes. It also guards against typos, you reduce n potential failure points to 1.
That's such a common junior developer mistake. I see it a lot - constants called ONE_SECOND or COMMA.
Hearing "Oh, make setting XYZ configurable" or "Stick a flag to turn FooBar'ing on or off" also fills me with worry, as all too often it has been the harbinger of terrible feature creep and piling on of technical debt.
However, not every hard coded constant should or needs to be in a config file.
(1) Making the variable a configuration variable will do nothing: it's not like you want two different versions of company policies at the same time.
(2) It won't help with testing, because any realistic test of the variable's change will involve changing the company policy and probably the way all systems behave.
In my opinion, making that into a config variable is a mistake. It's perfectly OK to keep as a hard-coded constant.