The above prompts the question "why didn't the subcontractor submit a bid to be the primary contractor then?"
In all my experience of contracting and sub-contracting, it's a matter of scope. A subcontractor often has skills in one area, but not the whole piece. Example, prime contractor takes on responsibility for delivering a system/solution - they know a bit about security but are not specialists....so they subcontract the security element to a specialist company who live, eat, sleep & breathe security but who don't have wide enough scope to cover other aspects of the solution, or even have the scale to manage another bunch of subcontractors who do.