It's both hustle and luck. One reason I left Microsoft was because I wasn't on track there. The organization was good but also top heavy so there wasn't room for growth. When I joined Rec Room the tech I built really clicked and the company scaled rapidly. Our team became critical and helped hundreds of coworkers advance their goals. I've heard another principal engineer describe this as, "being pulled into the white hot burning center of a company".
As far as I can tell there's no "trick" to hitting the role. I'd describe it more as, "repeatedly move mountains". There's some luck identifying the right mountains and luck + hustle moving them at all.