Why == works in an if statement?

They are two different operators. = is the assignment operator. == is a comparison operator.

In the first sketch,

  if ((Switch7 == LOW)  && (cycleCounter = 0)) {

causes an assignment to happen in the if statement. cycleCounter is set to zero.

In C and C++, assignment statements also return a value, that being the value that the variable on the left side of the statement was set to. This is why the statement above is acceptable syntax but obviously not what is wanted. The value of the assignment statement is zero, which in the context of the if statement is taken as a logical false value. Since this is part of an AND (&&) construct, the overall if statement will never be true because the second argument is always false.