How variable_get and variable_set works in drupal How do variables work? Is it as simple as using

variable_set('myvar', 'my_value');


to set, and

variable_get('myvar');


to retrieve?

Additionally, where are these variables stored, and do they have any sort of categorisation/access control (i.e. can any module get the variables set by any other module)?

Update from comment

I can see a line like $custom_theme = variable_get('admin_theme', '0');
But i cant see any variable_set('admin_theme') in anywhere in the module though .
Variables created through variable_set() and variable_get() are stored in the variables table in the database.

variable_set('myvar', 'my_value') 
is used to change the value of an existing variable to the provided value, or to create a new variable with the provided value if none exists.

variable_get('myvar', 'optional_default')
is used to retrieve the value of myvar. If myvar does not exist, then it is created using the value from optional_default. If optional_default is not specified, then myvar defaults to Null.