It's the standard grammar rules. Semicolons terminate statements, but statements may be empty, so these lines:
if (...);
{
}
are equivalent to:
if (...) /* do nothing */ ;
{
...
}
The following { ... } statement just looks like any other code block, and will always be executed, because the if statement is done with by then.