The doc at :h 'background'
should provide all the information you need:
When set to "dark", Vim will try to use colors that look good on a dark background. When set to "light", Vim will try to use colors that look good on a light background. Any other value is illegal.
Your colorscheme defines 2 groups of colors: the ones used on a light backgroundand the ones used on a dark background. The background
option will tell vimwhich group of colors defined by your colorscheme should be used.
Setting this option does not change the background color, it tells Vim what the background color looks like. For changing the background color, see
:h :hi-normal
.When 'background' is set Vim will adjust the default color groups for the new value. But the colors used for syntax highlighting will not change.
That's the follow up of the previous paragraph: It's the colorscheme whichdefines the groups of colors and background
selects one of these groups.
Finally if you want to write your own color scheme without having to put set background=dark
in your vimrc, remember that a colorscheme is nothing more than a program in vimscript, so nothing stops you from using the command directly in the code of your colorscheme like e.g. jellybeans or apprentice