My hypothesis: People stay at a company for the money, people or the work. They won't stay long with only one.
People need basic income - but they also need a purpose. The purpose can be solving challenging problems (interesting work or opportunities), career advancement, having fun (enjoying work with coworkers), or they just intrinsically love their work.
People can have a job (working for the money), a career (working for advancement, promotion, a sense if accomplishment), or a calling. The trick is framing your work and mindset to see the positive intrinsic value in what you are doing.
Where you do it? I think boils to one statement - happiness at work is based on the people and feeling valued for work you enjoy.