For most of the folks I've worked with, it's the case that if they take a job and they're not learning something, they're not going to stay long. And if they take a job and the choices are "stay here, even if they enjoy it" and "take a 15% compensation bump that will ripple through the rest of their career", it would be foolish not to go for the latter.
The places that understand that retaining people takes effort are less rare than they used to be, but they don't grow on trees. If you want to hire someone longer term, I hope you're putting the money, and the investment in that worker, on the table.
To be clear, I'm talking about a persistent pattern. Even those of us with fairly long-term employment (~10 year stints) in general often have one or two short stints for various reasons. E.g. dot-bomb in my case although the job wasn't a great fit anyway.