Two lines of code work. Want to understand the difference.

Please use code tags: Using code tags properly