The environment variable.ORACLE_SID is defined in .profile in UNIX OS. When the Oracle user logs in to, all the environment variables are defined. They are all used to simplify typing again and again. If more instances are configured in one Unix box, have a script to swicth from one instance to another. In one window, only one ORACLE_SID can be set.

Check oratab file to know all the instances running in the system.