A pay when paid clause says the general contractor will pay a subcontractor after the owner pays the general contractor. It usually only sets the timing of payment, so if the owner never pays, the subcontractor is still owed within a reasonable time.
A pay if paid clause goes further: it makes the owner's payment a condition of the subcontractor being paid at all. Some states refuse to enforce that. This page is general information about US practice, not legal advice.