If is a conditional - if A occurs, B will happen. If you don't hurry, you will miss the train. If you open the window I will get cold. If you are not careful you will slip on the ice.
What if is used to propose a scenario, which may, or may not be realistic. What if money grew on trees? What if we all go to the beach on the weekend?