You are right but I think there's a fundamental issue that many people think that 'as long as I keep showing up and doing good work, the powers that be will look out for me'.
By default work relationships work as you advertised. It needs conscious effort on your (and everyone's) part to reframe these relationships as something that's between you and your friends, on your own terms. Consciously hanging out together, talking to each other, doing projects together outside the context of work. Social relationships need to be built up with effort. The company will do this for you, because they enjoy the benefits of a crew that works well together, but if they put in the effort, the relationship will belong to them. You will think that 'I could get slightly more at this other place, but I like my colleagues here', realizing you'd lose the social net if you changed jobs.
I think a huge problem with nerds (like me and probably you), is that we don't understand the fundamental power dynamics that shape society, because we lack the inherent cunning and weren't forced to face down enough hardship to have our illusions shattered until later in life.
Truth is, if there are rules, somebody needs to enforce them. If something nice happens, it does because somebody makes it happen. These things are mental abstractions designed to make your life predictable, but like every abstractions, sometimes things happen that were supposed to be impossible, because the system doesn't work the way you think it does.