I think what we do is called "professionalism" rather than "loyalty" - they pay us for our time and it's a questions of professional pride and moral obligation that we are there doing the work for them, in a reasonable professional way to the best of our abilities, but no freebies.
They might decorate it with "we appreciate your work" hypocrisy and bullshit, but they treat it as a "supplier" business transaction hence I'll treat it from my side as a business transaction too, which means what's in the contract is what's in the contract and if I find a better "client", I'm off.
After less than a decade as an "employee" I actually became a freelancer and it has served me well and I never regretted it, even though I was in the middle of each of the industries worse hit by the last to major crashes, first Tech and after that Finance. Job security is an illusion, so you have to build your own security by making sure you're well paid for your work and hence can fall back on your savings even when the whole Economy plunges and even the few genuinelly good companies to work for still end up firing most of their people.