L5 mentors L4 who mentors L3 and so on.
Related, more cynical take - being a mentor is often a factor in promotion & hiring, and being viewed as a mentor will make you more likely to be promoted or hired.
In software development it is even more egregious because, due to exponential growth of number of developers, most developers haven't had a chance to work with a real, good, expert developer.
You need probably at least 10-15 years and more realistically about 20 years to grow to be expert at your field. And even then only small percentage grow to be truly experts, the rest become stuck somewhere along the way.
How do you asses whether you are mentor material if you've never seen a real deal?
You don't hear people who decided they are not mentor material yet -- you only hear from people who did.
So this is the false positive problem -- given even small chance of false positive on deciding you are mentor material, given huge population of developers and very small population of actual good mentors, you are bound to have a lot of false positives.
You don't need to be an expert mathematician to be a great Math teacher; you don't need to be a happy well-rounded person to be a good therapist.
- have the knowledge (duh!)
- have the experience to have had enough time to observe things in reality (vs theory) and have had the time to internalise and digest all of this
- be mature
While it is easy to get the knowledge, the rest usually cannot be skipped so easily.
As to math, that is not a good example. Math is almost pure knowledge and intelligence and so a bright kid can acquire that knowledge and quickly pass to his peers assuming they are intelligent enough.
Unless you really mean Mathematics. Like how to advance the field. Then it is not as easily transferable knowledge. I know, I studied theoretical mathematics.
Software development is only in small part driven by knowledge. If you think software development is knowing programming languages and frameworks and AWS and certifications you are waaaay off the target.
I don't think I would've been able to right my career had I not had a dev with about ten years experience mentor me for a year. Granted, he might be an edge case since he learned teaching before becoming a programmer, but nonetheless his empathy and encouragement on top of some lived experiences was invaluable to me.
I have this model where you can get regular help with what you want and mentor help with what you need.
Mentor will be mature and experienced enough to be able to recognise your particular needs and be able to adjust to you. Mentor will be able to understand their own limitations and adjust for it, too.
On the other hand, experience is mostly orthogonal to technical and pedagogical skills. After decades of experience I've seen mentorship come in many forms, and I would never put some kind of litmus test on who is qualified to be a mentor. Ultimately it's about individual strengths, weaknesses and chemistry.
Of course, maybe I'm rationalizing and it's just that candidates who aren't fresh out of college need to claim some leadership credentials, and they don't want to lie and say they've formally led or managed anybody, so they just make vague statements about mentoring in the hopes that you check the right box on the hiring rubric.