Different light sources have different color wavelengths, as you probably realized, sunsets give you an orangy light, while twilight and dawn gives you a bluish light. With artificial lights, the same thing occurs, tungsten/incandescent/halogen lights are warmer (more red) in color while fluorescent is bluer.
The incredible human eyes does not see a significant color shift in lighting and we’re not that affected by it. Camera sensors and film, however are designed for a certain color temperature, especially with film. Digital sensors allow you to change the color temperature on the fly with white balance settings, which is a lot more convenient that film days where a filter has to be screwed on with each light shift.
Correcting white balance means that you’re making sure what’s white should be white in the scene, unless intentionally altered by a colored light source (like a colored stage light, for example).
Why did I specifically include the word “flash” in the topic, then?
Like what I’ve mentioned in the flash articles previously, the camera and flash are separate entities that tries to work together when it comes to color and exposure.
Your flash’s color temperature matches daylight’s color temperature, in general. If you’re shooting under the sun, your flash and camera’s daylight/auto white balance presets will give you an image with consistent color in both ambient and subject. However, when you introduce a significantly cooler or warmer ambient color, such as shooting during sunset, indoors with incandescent, you can only alter the white balance in your camera, not in your flash as flash guns don’t have white balance presets.