Correct me if I'm wrong, but your tone makes me believe you think your coworker made the wrong decision.
I'm actually jealous of your coworker. Currently, if someone offered me a better career opportunity, I'd likely take it without hesitation; but I wish that weren't the case. I don't hate my current position, but I wish I loved it more to the point where leveling up, learning the newest framework, and making more money wasn't the priority.
On top of that, everyone around me seems to be more focused on the trajectory of their life rather than their current situation, so I feel like its hard for me to get out of this rat race mindset.
I think the current tech industry rat race and churn is socially stifling in the sense that you must become nomadic and chase opportunity. By the time you settle in its time to move again. I see people working the same job at the same company with families and homes who although make less than the average tech worker, appear to me much more happy and fulfilled in life.
'Moving on in your career' may be horribly overrated, or at the very least not something everyone prioritises the same way.
Enjoying the work you do, and the people you do it with, and being satisfied by same, may be a sufficiently compelling reason to not engage in high-risk behaviour for the sake of 'advancing your salary'.