1) a bond (not that it necessarily means THAT much, but it’s not trivial)
2) no negative outstanding complaints on said license
3) no negative history with the owner, GC, or prime contractors.
4) history of successfully completing equivalent work without screwing over everyone else involved.
5) on union jobs, the right kinds of union support.
The ‘basically’ in your statement is doing a lot of work.
No GC with a chance of staying solvent accepts random low bids from contractors they don’t know, have history with, or that don’t have history with someone they know doing work successfully of the same type.
Rework is already enough of a problem without having to completely redo plumbing, electrical, framing, carpentry, what have you because a sub screwed it up - and disappeared or is now insolvent.
Going after someone’s license takes forever, same with suing someone over damages, and it’s not like a bad sub disappearing in a drunken bender (or worse) after a screw up never happens in certain corners of the industry.
Will folks get squeezed a bit? Sure, it’s part of the game. They also fluff a bit, also part of the game. Somehow, the folks who know how to play it end up solvent and with new trucks at the end eh?
But avoiding fly by night subs is an even bigger part of staying alive. Public works are a classic shitshow on this front though in some areas.