What are the three exposure controls that affect an ambient exposure? You can adjust the ISO, the shutter speed or the aperture, and you'll see differences in the ambient exposure, right? But did you know that only two of those controls have an effect on the flash exposure? It's true. Changes to the ISO or the aperture will change the way the flash exposure registers on the sensor, but changing the shutter speed will not. This is the key to balancing flash with ambient light: understand that shutter speed only affects the ambient exposure, not the flash.
Because changes to the shutter speed affect only the ambient illumination, you can use the shutter speed to bring in more ambient light, or to make it less prominent, without affecting the flash's illumination of the subject. Pretty cool, huh? Can you see where this is going?
You can go about balancing flash and ambient exposures in two ways, but I like to work in manual exposure mode for each. This is especially helpful while you're learning because working in manual mode eventually will lead to an understanding of exactly how certain camera controls affect the image, and that's certainly helpful when trying to balance two sources of illumination.
The first approach could be considered the "brute force" method because you're simply going to slow the shutter speed from a normal flash-lit scene to introduce ambient exposure. It works, but sometimes the effects are a little unrefined.
For instance, let's say you're shooting at ISO 400 and a shutter speed of 1/125 sec. at an aperture of ƒ/8. With a flash on your camera (or, better yet, a flash positioned off-camera for more interesting lighting), this kind of exposure is likely to produce a usable photograph of a subject well illuminated by the flash. (Whether the flash is controlled manually or via TTL metering doesn't matter. That said, I find manually adjusting the power of my flash to be a great way to take control of the output and make sure it's the same every time. It also may be a helpful way to wrap your head around controlling every exposure element manually.) Let's say your flash is putting out enough light at half-power to produce a nicely illuminated subject with an ISO of 400, and a shutter speed and aperture combo of 1/125 sec. at ƒ/8. If you changed the aperture to ƒ/5.6, the subject would get brighter—and so would the background. If you moved to ƒ/11, the subject would get darker, as would the background. So changing the ƒ-stop affects ambient and flash simultaneously, amounting to no change in their ratio. The same thing applies to the ISO: Its changes affect all types of lighting equally.