It is often much easier to hire internally than externally. And that's good. It keeps people happy within the company vs forcing folks to move on. Onboarding new employees is expensive. If you can shift 1 and keep them happy vs having them leave and having to externally hire 2 it's a win.
For my team (I have no hiring decision, just input), I frequently look for smart people dissatisfied with their work somewhere else. Things I look for: people wanting to work on something more interesting, work with a higher performing team, having greater "impact" with their work, wanting a new skillset, stuck without upward mobility, wanting opportunities for more visibility, etc.
It also avoids the gamble of a resume and behavioral interview. You know the person and can take a reasonable guess on their "fit" with the team. You know their actual skillset ("hard" and "soft" skills) vs claimed.
We've lost a few to job hopping, but for the most part, it's a much better predictor of someone who will stick around, be happy, and be a valuable contributor.
You do have to followup with being an advocate for those high performing people. That can just be recognizing their work publicly or pay/promotion opportunities.
Also, if someone is frustrated with the job on my team, I try to use my internal connections to find a place that they will be happy. I really do care about them as humans and see happiness and job satisfaction as more important than hoarding them.
From the other side, every job I've taken (internally or externally) based on people I know has worked out great. Every one I took by just applying to a posting, notsomuch. No it doesn't sound fair or like a meritocracy, but it's human. Walking in with trust and understanding is a real advantage.