I don't think that's necessarily true. Some companies and seniors certainly invest into training and mentoring their juniors and this can take a long time and be expensive.
But there are a lot of places offer 3-6 months internships for people that are barely out of high school. Others heavily rely on overseas contractors.
So in a lot of scenarios it does seem possible to use less capable labor in a beneficial way for software engineering.