That’s the point. Once you have “molded” the junior developer for a year a two, they can easily jump ship for greener pastures.
I’ve seen the argument about paying them market rates. But honestly, if they are young and unencumbered, their “market” is the entire US. Meaning you may not have been in the position to pay them what they could make if they were willing to move across the country.
To go into more anecdotal detail, I had been programming as a hobbyist since I was 12 in assembly for 10 years by the time I graduated from a no name college in the south. I had two job opportunities - one making an entry level developer salary writing COBOL [1] in a slightly larger city, or working as a computer operator in a major city. I chose the latter job that paid much less just to get to the city. I got lucky and I was the only one who knew how to program so they gave me the previously mentioned project straight out of college. They gave me a raise the next year to that of an entry level developer (I was hourly at first and got a lot of overtime).
But now, three years later, the project was done and with a major green field C project under my belt, my market value had gone up more than 50%. They couldn’t justify paying me that and I got another job.
Now if a similar scenario had played out in today’s market instead of 1999, even if they could have matched my local salary of $80-$100K for a mid level developer, I could have spent a year studying “algorithms and leetCode”, picked up and moved to SV and doubled or tripled my total comp. There is no way they could compete with that.
Let’s look at the current state of affairs. Almost every engineer at my company is between 35-50. They purposefully created the office in the burbs three years ago to attract older developers. They not only get experience, paying local market salary is relatively easy comparatively. The chance of any of us uprooting our families, selling our big, relatively cheap 3000 square foot houses in the burbs with the great school systems and moving to the west coast is slim.