If expression confusion

Can anyone provide some insight, thanks!