% or modulo returns the remainder from division so variable%2 would be the remainder of the variable divided by 2. Then as you know, any even number divided by 2 has a remainder of 0, since they are all divisible by 2. That also means any odd number will not be 0.
? : are conditionals. If you do a comparison, like 1=1, the system will take the question mark to mean that anything after ? is to be taken when the condition is true. Then anything after : is to be used if it was false. so 12%2=0 would give you 0 as a remainder, and be true.