When I was piecing together how I got to be a relatively young lead developer, it came down to my open door policy. I essentially rediscovered Hamming's wisdom just by extending a policy that started with my college roommate who was struggling with our CS homework. That lead to me helping other kids in the computer lab (with C/C++ bugs, not with the algorithms), and if you have skills at <5YOE you're going to use them at work if you can, because what else can you do to not look like a newb?
But open door policy doesn't have to mean a literal open door. When I went remote I was still helping people sort out problems, and when you ask for the back story you get to find out what other teams are working on, and where 1/3 of your coworkers are all struggling with the same API. That's a lot of ammo for a Staff, Lead, or Principal-track role.
Because you understand a lot more of the project, and you already have the trust of half the org chart.