If’ usually introduces conditional clauses. The same applies to other conditionals such as unless, should and in case which, however, perform other functions in different contexts.
Conditional sentences express a connection ... If the if clause is first, the two clauses are separated by a comma. There is no comma if the result clause is first.