In one place I worked it was about helping junior engineers reinforce the things that were otherwise a difficulty for them, and it happened with both sides wanting it and evolving goals throughout the months. Assess the needs and discuss them if there is a disagreement, establish actionable items, set up metrics together that can be tracked more or less loosely depending on the subject and the people, and when necessary figure out ways to communicate to the team or to higher up any request related to that project for growth (time to learn, structural change, etc). And when it doesn't make sense to do the mentoring anymore, just stop. It doesn't have to be a permanent thing at all.
Sometimes practically it might have been about technical stuff, but really it was mostly about helping people communicate better and helping them navigate the structure of the company to feel more at ease with its different parts. Sometimes it enabled them to bring to the surface skills they weren't confident they had or that they had but weren't being put to use. People outside the team would also tend to notice the change positively, which can have an impact on a junior's career path.
IMO, for most people in tech the problem is fairly frequently anything-that-isn't-tech-itself.
It can be very empowering within a team to have people who grow beyond their comfort zone with the perspective of a more experienced person who also knows your day-to-day struggles.
Of course that implies working in teams where there's an investment in the teams, in the individuals, in the value of long-term returns of such growth, etc. Not a fit for every company - I just happen to have experienced such things at a very nourishing place.