Variable is a named definition that has been given a value, and that value can change at any time. Hence the name variable (a "changer")...
In OFP the variables can include almost anything, either a string ("hello", a word inside quotes), a numeric value (like 2) or a boolean value (true or false) or unit's name (given in the editor)...
So for example in
_newNumber = 5
the _newNumber is the variable and 5 is the value it has...
Now, when the variable has the _ in the beginning, it's local variable which means that the variable in question has a value that is script specific.
So, if you have 2 scripts, let's call them A.sqs and B.sqs, and in both of them you have the same named variable, _newNumber.
Now in script A.sqs you have _newNumber = 6 and in script B.sqs you have _newNumber = 8...
Even when both of the scripts are run exactly the same time A still has _newNumber = 6 and B _newNumber = 8 because both variables are local (script specific) and so the changes on the same variable in other script won't affect the other...
Think of the local variables as exactly same car model (same color, year, etc) but with different license numbers....
Global variable is a variable without the _ in the beginning, like newNumber = 5.
This means that once the variable is defined (is given a value) it's available everywhere with that same value and if that value is changed somewhere, it changes everywhere...
So if in script A you have newNumber=6 and then script B runs and has newNumber=8 the variable newNumber value changes to 8 in both scripts, in script A and B...