But the junior will do at least some real work that hopefully benefits the company while they are there. There is at least something on the "benefit" side of the cost/benefit balance to entice them.
The problem that AI creates is that it tends to eliminate even that benefit. The task I would assign to the junior as their first task, which I expect to take them some weeks on as they not only do the nominal task but acquire all the surrounding skills and knowledge to finish it, is now a prompt and the senior engineer intermittently checking in on the AI's completion of it. It's hard to justify hiring the junior and paying them for six months if the senior can do the task(s) they'll finish before they jet off to their next job in a fraction of a day or two.
I have written this from a point of view that is foreign to me to explain the problem from their point of view. I do not accept this formulation wholesale, though there are substantial kernels of truth in it that anyone who wants to convince a real person that they are wrong about this assessment will have to deal with. I'm a very long term oriented person and still believe that raising up talent within your organization is extremely important. After all, in the end, what even is your organization except the talent you have within it and the system you've built for it to operate? Unless you think you can operate without any people at all, people are a vital part of your organization and you'd better be growing the best people you can or you can expect to get beat in the long term by an organization that did invest.
But when I look out at the world, what I see operating in most people and companies is much closer to the point of view I described first. That "beat in the long term", however long it may be, is certainly longer than one quarter or even one fiscal year.