Complicated answer. The one truism is that there is absolutely zero loyalty on either side.
I would add, I don't think this is universal. It may be true for a great many large companies.
But for a ton of smaller companies, I think the dynamics can often be different.
I do think it starts with the assumption it has to be fair for both sides.
An employee offers their services in exchange for money / benefits from the employer.
The work offered and the compensation paid should be equal so that there aren't any other significant factors.
An employer can't under pay and expect the employee to stay because of "loyalty" or some other reason.
An employee can't do way less work than they're being paid for and expect the employer to just pay for some outside reason.
It has to work for both sides.
And like anything, there has to be reason and understanding.
The cashier at the grocery store I like said something to me about how long she'd worked at the store. I said something like "It must be a good place to work". And she commented that she'd had some special thing come up years ago and the company did way more than they had to in helping her. It was pretty clear she was now loyal to the company. Stuff like that happens sometimes and that's reasonable.
But for the most part, the work offered and the compensation given for the work has to be equal.