You don't get paid until the prime gets paid.
Pay-when-paid clauses tie your cash flow to the owner's cheque-writing pace. Pay-if-paid clauses go further and try to make owner payment a precondition. Both are common. Both shift risk from a multi-million-dollar prime to a sub doing $1–2M.