In my experience working with juniors, the ones that look to leave are the ones that don't have their compensation appropriately adjusted as they rank up.
Pay everyone well, treat them with respect. Challenge them, and give them raises and rank-ups as they gain tenure and skill (not when it's "in the budget, and oh sorry, we can only uprank one this year, but we hired a person at the higher level, so really we can't afford it. Try again later!"), and you'll have people that stay a long time
Because over 10 years, you'll have attrition in your seniors as they retire and you'll have juniors that have climbed the ranks and have built half the systems that are now juniors replacing them.
And treating employees with respect the whole time builds an *incredible* amount of loyalty. You also get opportunities for your existing seniors to help grow new team-members, which some of them seek out, and so on.
In my experience working with juniors, the ones that look to leave are the ones that don't have their compensation appropriately adjusted as they rank up.
Pay everyone well, treat them with respect. Challenge them, and give them raises and rank-ups as they gain tenure and skill (not when it's "in the budget, and oh sorry, we can only uprank one this year, but we hired a person at the higher level, so really we can't afford it. Try again later!"), and you'll have people that stay a long time