No, it doesn't always work like that. It works that way enough of the time to be worth trying, though. Even if it doesn't get you a raise at your current job, having done things that add value gives you a better negotiating position for a different job.
Exactly. You could do me the minimal amount of work required to stay employed but then you can't expect a generous raise, unless you manage to play office politics very well AND the workplace is quite toxic to allow that.
Personally, I try to give a fair amount of effort to deliver more value than expected. It doesn't mean that I am working 60hrs/wk or anything like that, just trying to be creative and not asking anyone to hold my hand in my explorations.