Switches offer a method of saving a boolean (true or false, yes or no) to memory. They can be used to save toggles, such as if a menu is open, a character is present, and so forth.
Contextually, switches are supported globally and locally.
Local contexts are generated for an individual instance. Local instances are usually setup on their respective containers and only exist while that container is active. If the container is no longer in play, the local data is removed.
Global contexts exist throughout an instance of a game, regardless of where they exist. This is the default way switches are implemented in most engines.