Can someone explain to me how subcontracting helps anyone?

One big exception is when it’s the government retaining the contractors.

This is the ideal for subcontracting. The customer hires one person who will essentially act as a project manager. That person knows the business and the people working in the field and can hire the people for each aspect of the overall job. The customer ideally gets the benefit of having a professional doing all of the management rather than having to deal with a bunch of people in a field they know nothing about.

Let’s say, for example, that you’re planning a large wedding. If you do the work yourself, you’re going to have to hire a decorator, a cake maker, limo drivers, a catering service, a photographer, waiters, a bartender, a DJ, etc - and if you’re an average person you’ve never hired anybody in any of these jobs. You’re going to be choosing people almost at random and hoping for the best. You’d be better off hiring a wedding planner who does this for a living and knows all the people in these various businesses. You hire the planner and he or she will take care of everything else.

My son works for an IT subcontractor, mostly dealing with retail clients. One, for example, was rolling out a new POS system in thousands of locations. It took a large number of people that the client would never have needed on a permanent basis. They save money, my son has a job.