It's not the same, it's practically the same. The assignment operator returns a when done with the assignment. The if checks this value, in other words: a is assigned 1. a evaluates as output of the assignment operator (which is 1). The if checks a (which is 1) and is always executed (in this case).
The conclusion of this line of code is that a is assigned 1 and the if always evaluates to true (in this case). The == isn't an assignment operator, it checks for equality. (Is a equal to 1?)