|To expand on M2's answer:|
variable is just the word 'variable' (but see below).
%variable% gets "expanded" i.e. translated to its value and literally substituted in the command line before the interpreter even gets to see it.
!variable! get passed as that to the interpreter, which then does the expansion itself. To use this, you first need to enable it for the current batch file by adding this command at (or near) the start:
There is one exception to the above rule, which is when you use the SET /A command. A plain SET command (and all other commands) will not expand the value of a variable, but will treat the variable name literally. But SET /A knows that it has to work with numbers, and only numbers. Therefore, when it finds a word that's not a number, it treats it as a variable. Thus you don't have to say:
SET /A z = !x! + !y!
but you can just say
SET /A z = x + y
Note also that I've got spaces around the = sign. Normally you shouldn't do that, or you'll be defining a variable whose name ends with a space and whose value begins with a space. But SET /A understands that the space around = is not to be taken literally.