It all comes down to basic color theory and the color wheel. That same tool that teachers used in school really is the basis for how designers plan and use color in almost every project from the simplest web page to expansive brands with multiple sites and campaigns.
Scientifically speaking, color is the visual presence of light in different wavelengths and relates to how these wavelengths are absorbed or reflected. Total absorption of wavelengths results in no color (black) while complete reflection results in white. Anything in between creates a color.