What is the difference between the following two variable declaration?
unsigned char var; and unsigned char data var;
"According to me, all operations with that variable will be done with a "garbage" value."
Yes, that's right.
If you tell the tools to use XRAM they will do so. As Erik says, they have no way of knowing what may or may not be present in your target hardware - they just do as they are told.