I've been on both ends of this, as an employee a few years ago and now an employer. I'm not sure if assuming the worst in all employers and putting in the bare minimum/acting unethically to avoid being "taken advantage of" is the optimal way to act.
It pushes away the good companies that will reward loyalty and drive, and attracts unethical companies who have an adversarial relationship with their employees.
Same goes for relationships - if you assume that the person you're going to marry is simply going to take your house and kids and build your relationship about minimising feeling stupid if/when it happens, you're not going to have a good time.
Which are these companies that "reward loyalty"?
I can't name a single one in the US market. Every single company cares about one thing only: its bottom line.
They will retain any employee as long as it's good for their bottom line. Once it's not: adios.
I've never heard of a company retaining an employee due to their "loyalty". Maybe it was a thing in the previous century?
I assume they hired me because I could help make them money. If one day that assumption isn’t met and they need to lay me off (been there done that), I call my wife, I call my network to tell them I’m in the market. There are no hard feelings.
But also don’t trust your employer. Require important stuff in writing and contracts, don’t expect your employer to give anything extra for hard work / overtime (unless it’s in contract), don’t rely on “promised” benefits or rely on your employer to do anything they don’t have to.
And also, if you get another offer which pays 200% after accepting, or one which requires you to quit immediately, you might want to break loyalty. IMO this should go both ways: the company and employer should expect the other party to “betray” them if there’s a huge bonus like that. In fact all of this goes both ways and company/employer should have a decent, “loyal” relationship to an extent, but never put too much trust into each other.
* the other exception is toxic workplaces where your boss is being an asshole to you. Although in that case you should be trying to leave ASAP
Is that mercenary? Yes. Do I like it? No, not really. But in the USA where I live it's virtually universal policy with private employers.