What does this if-statement do?: if($pages=’ ‘) {}

$pages is an optional parameter.
If not set, $pages will equal an empty string.
So if($pages == '') checks to see if that parameter has been set.

In this call, the parameter has not been set: kriesi_pagination();
In this call, the parameter has been set: kriesi_pagination(5);

In the tutorial link that you posted, read this section again, the part that starts

As you can see we got 2 optional parameters to pass:

tech