An "if" statement is handy if you want something to be done conditionally - only do this piece of code "if" some condition is true. If the condition isn't true, the code is skipped (unless you have an else, etc), but the flow of code ends up passing through once and then moving on. A real life example would be a door - if the door is locked, then ring the doorbell.
if (DoorIsLocked) {
RingBell()
}
In terms of code flow, it will flow through once.
"while" allows you to have a loop. ("for" and "foreach" do as well). A loop lets you execute some chunk of code over and over until some condition tells you to exit. The real life example would be a door as well - ring the bell. If nobody opens the door, then go back and ring the bell again.
while (DoorIsLocked) {
RingBell
WaitAWhile
}
This code will loop over and over until the condition is true. This loop is a bit naive as it will keep ringing the bell forever if nobody answers the door. You'd probably want to have some other condition for exiting in this case.

I hope that makes a little bit of sense. If you haven't used "while" before, try it out. It has its place in your scripting toolbox.