when there are two alternatives and we want to say that something will happen or will be true in any of those two alternatives.
• I’ll help him if he needs me.
(=I will help him only if he needs me.)
• I’ll help him whether or not he needs me.
(=I will help him if he needs me, and I will help him if he doesn’t need me, too.)