They all have to be saved somewhere. A lot of Mac only apps also use the defaults[0] system which allows you to read/write values there.
man defaults
defaults domains | tr " " "\n"
defaults read com.apple.Safari
For dot files, I personally use stow[1] but there are other utilities and workflows out there[2]. [0] https://ss64.com/osx/defaults.html
[1] https://www.gnu.org/software/stow/
[2] https://dotfiles.github.io/