Apps need settings like database hosts and API keys that change between laptop, CI and production. Environment variables pass that config from the shell to every program it starts, without editing code. Use them for PATH, for secrets in CI and for docker run -e style config. A plain variable stays in the current shell, so export it for child processes, and use source when a script must change your own shell.