so your saying that if you have data as globals another separate program is allowed to manipulate that data easier? I thought it didnt matter where it was in RAM?
No, that's not what's being said. Programs are in separate memory chunks. Only if you take special actions to allocate some shared memory will different programs have access to common data.
Global variables are visible to all functions in your program. Because all functions can change the global variable, there's always the danger/temptation for all function TO CHANGE the global variable. In anything beyond a trivial program, you quickly lose control over who should change the variable, under what conditions it should change. You also lose the ability to easily use any function in another program if some global variable must also be replicated.
A function should act like a "black box". You know what goes in (the input parameters) and you can see what comes out (the return value or any parameters passed by reference). What the function does inside itself is of no concern to any other function in your program. Global variables add an unknown factor to this clean input/output picture.
To say that global variables should be avoided "at all costs" is a bit extreme - as are almost all absolute statements. Sometimes there may be some variable which a large number of functions need access to, and some may change it, and all need to be able to know the current state of that. Perhaps some configuration state of the program. So sometimes, a global makes sense to use. When that is the case, DOCUMENT THE HECK out of it - state clearly what functions should be able to change it, under what circumstances.