One thing I wish someone told me earlier in my career is that the skills and activities you need to perform to get promoted are totally different than the skills and activities you need to perform to get your job done, which by the way, are different than the skills and activities you need to perform in order to pass the interview and get hired. Not "related" or "complementary" to the job you are hired for--totally different.
Promotion is about marketing. Getting your name in a favorable light in front of the deciders, and projecting an image of "someone who is like other people who we promote." Different companies do this differently. At some of them, it's about directly brown-nosing the higher-ups. At others it's about getting in the right cool-kid clique. At others it's about playing golf with key influencers or talking about sportsball with them in the lunch room. At others, who pretend to be merit based, it's about writing docs and "evidence" of your good work, but don't be fooled, those docs are marketing material, not technical evidence. Getting promoted is a separate job skill you need to learn, just like debugging and DevOps. Except it's a skill that does not benefit the company's bottom line at all. You have to set aside time and stop doing the work that you were hired for, stop solving the technical problems, and switch gears to doing the unrelated "getting promoted" work.
Nobody in leadership or HR is going to explain it this way, of course. You kind of have to learn about it organically or listen to someone like me who had to learn it the hard way.