Who sets the BROWSER environment variable in macOS?
BROWSER is not set by default on macOS. Where exactly it is set depends on the shell you are using and its specific configuration:


bash: /etc/profile, ~/.bash_profile, ~/.bashrc
zsh: /etc/zshenv, /etc/zprofile, /etc/zshrc, /etc/zlogin, ~/.zshenv, ~/.zprofile, ~/.zshrc, ~/.zlogin


Besides the configuration files itself the variable may also get set in a script sourced from one of them.