An "if" statement is just an extension of boolean logic.
A lot of times, bash programmers will do this
if [ "${HAPPY}" == "Birthday" ]
then
... (do something)
fi
In English, that means "If the string in the variable HAPPY is the same as the string 'Birthday', do something"
But sometimes, if there's only one something, there's a shorthand trick: the double ampersand, which means "logical and".
Logical ANDs work a lot like the bitwise ANDs you're used to at the machine level. That is, if you were adding the numbers 1 and 7, or 1 and 111, you would get
001
+
111
___
001
since the only bits that are the same are the 1 at the very end. Similarly, a logical AND works only if what is on the left hand side is the same as what's on the right hand side.
Now here's the trick: given the above example, I could have added 1 to anything and, with a bitwise AND, gotten either 1 or 0 as a result (1 and 0 is 0, 0 and 0 is 0). I don't even have to test the first two bits; whenever a zero combines with anything, I'll get a zero. So, you can use a bitwise AND as a logical AND provided the argument on the left is zero, and you have an odd integer or zero on the right.
Therefore, that if...then statement earlier can be written like this:
[ "${HAPPY}" == "Birthday" ] && do something
Why? Because the only time the computer will even look at "do something", is if the test on the left side of the logical AND returns true.
In other words, we can turn that around and say that an if statement is simply a special case of a logical AND, which in turn is just a special case of a bitwise AND. The computer simply treats the condition you are testing for as either the number 1 or the number zero. And the only part that needs to be boolean is the condition on the left. If it is zero, what's on the right is ignored, otherwise, it is run.
That can go as low a level as you want. If I have an electric circuit sitting past a transistor, the circuit will only have power if there's enough electricity going through the transistor.