Why do companies hire junior software developers?
It's not like they have much of a choice. They either need to coax experienced developers away from other companies or grow their own.
- According to Robert Martin "Uncle Bob", author of Clean Code, the number of software developers doubles every 5 years. Here is a 6+ hours playlist of him on YouTube.
In addition to that:
- Senior software developers are mortal. They die. They retire. They need to be replaced.
- And out of those that haven't died yet and haven't retired yet, many get promoted into management positions, to help lead or train the newer generations of developers.
- The term "software developer" is also a moving target. Although many fundamentals remain the same, the field and the tech stacks are constantly changing. Many software developers are life-long learners, but just as many are not, and some become unqualified to do the work or simply decide to leave the field entirely.
- Many junior developers are also willing to work long hours or work outside of work hours to keep up with new technologies, but as developers get older and more experienced, and as they may get a life outside of work, their priorities can shift away from it.
Again, since there are not enough experienced developers, or more precisely not enough qualified experienced developers, to go around, this leaves a vacuum of work for junior developers to try to fill in. There is actually a ton of churn in the industry. It's also a possibility that many junior positions, in the less selective companies, become open simply because the previous junior developer who held the position couldn't do the job to the satisfaction of their employer.
And now, I'll try to answer a question you haven't asked but maybe thinking about. If companies really hire "junior developers" and if there is so much churn, why is it so hard to find advertised "junior developer" positions?
That's because many people want to become junior developers, and companies get flooded with job applications, whether they advertise for those junior positions, or not. And it's expensive to screen all of those applicants.
So the bulk of the hiring of juniors gets done through the "hidden job market". If you don't know what that is yet, please google it. This answer has veered enough off-track already.
I'm a student about to start looking for employment in the field of
web development, trying to understand better what is expected of me in
the first place
This part of your question is actually very difficult to answer. "Web development" is a very wide field.
Web development at a Big Tech company like Google is going to be very different than web development at a small mom-and-pop online shop with only two or three employees.