1) In the long run, benefit accrues to value generation. The "best developer" turning out "amazing code" that misses the business goal is generating zero value. It's a hard fact to swallow.
Ideally you are someone who can both engineer good code and be at least a part of the brain trust that "aims" that code at value (solving biz problems and generating money.)
That sounds obvious but most people don't even think about that. My rule of thumb is that unless you are actively involved in that - ie acting as a product manager to some extent - you are likely under-delivering for yourself.
2) your biggest limitations are within yourself and you don't acknowledge them. That's the classic "I identify as X and therefore don't do Y" mindset, where Y is the thing that would "unlock" your next level. Like if you are "a C++ developer who isn't interested in talking to customers" then perversely, learning how to talk to customers (and not learning the next C++ standard) is the thing that will let you double your comp.
3) Your attitude determines your outcomes. People who assume all work situations are shit (assuming that bosses are always evil, coworkers are always stupid, etc) end up in precisely those situations. If you have a more positive expectation (eg want to give and receive loyalty, want the company to go above and beyond for you and to go above and beyond for the company) you can find those work relationships too. (Btw that applies outside work as well. If you believe all women are evil you end up an incel, etc)
4) Work is a team thing, and the people matter. How you are with people matters too. Whether people are looking forward to or dread meeting with you has a huge impact on your productivity and therefore your career. Also, there's a Darwinian element you should recognize. If your team succeeds, your colleagues get bonuses and grow and that should matter to you, not just whether that happens to yourself.
5) You get paid for impact in the long run. This is related to point number 1. Sometimes your impact isn't code but persuasion. I once convinced a company to shut down a line of business and focus on other things. The value of that is much greater than any code I wrote. To make such impact you need to (a) have original perspective/insight and (b) convey it to people who don't have that insight! If you are constantly frustrated because you are misunderstood, you need to make a conscious effort to learn how to persuade people in person and in writing. And to recognize that it's a slow and difficult process that most people fear and therefore fail to go the distance.
6) The concept of work life balance is misleading and too simple a frame for good outcomes. The homeless guy under a bridge has a great work-life balance (0 work) but his life sucks. On the flip side, some successful people work tons of hours and have a great life - because they enjoy their work and they enjoy the financial benefits.