In this case, when you first enter the while loop, x = 4 since you have x = x - 1 in the beginning. When x becomes 2 in the loop, then the program hits the "if" statement which prints "small x". The program goes to the beginning of the while loop again, sees that x = 2 (so it passes), then it decrements x by 1 so now x = 1. The program would hit the "if" statement since x = 1 is less than 3 so it would print "small x" again. Since x = 1 now, the program would exit out of the while loop.
Hope that probably over-complicated explanation helps.