The company is not your friend and not your enemy, I agree. However, people _do_ develop personal relationship with each other. Sometimes even across the different levels in the company hierarchy. Yes, as with any other relationship, circumstances and interests might override this, but relationships still do matter. People have emotions, and there are managers who're not psychopats and find it very hard to e.g. let people go.
And yes, value yourself, absolutely. And your job is not your family or your identity, and manage risk, and there are bad bosses and bad company cultures. But it's not uniform.
But please don't think that nobody cares about you in your workplace and you're a completely fungible cog. It's a horrible life to live. Let's not tell the already cynical young people that this is how the world works.
Even at big, bureaucratic companies like big investment banks, if you're at a certain level (not that high), eventually you'll mostly be taken care of. Not everyone and not always, but e.g. if you're an ED at an investment bank, you can have a job for life, maybe not at your current place forever, but the industry will take care of you. Similarly if you've been at dunno, Mercedes for 15 years and you're not the bottom 20 percent in terms of performance, then it's kinda guaranteed that you'll have a job in the auto industry forever.
People who have been let go from Google today can have an extremely lucrative job forever in the industry.