With continuous light (ambient light), your exposure is based on the amount of light, shutter speed, ISO, and aperture size. (See What is the exposure triangle?)
However, light from a flash is very brief; generally 1/10000 to 1/1000 second, depending on power level (more power, longer flash). This means that shutter speed, up to a certain point, shutter speed doesn't matter.
There are 5 factors that affect how much exposure you get from a flash:
- Flash power. Scientifically, this is measured in lumen-seconds, but it's more practical to use Guide Numbers, which are given as a distance. More on guide numbers in a bit.
- Distance from flash to subject. The intensity of the flash decreases proportional to the square of the distance to the subject. This is known as the inverse-square law
- Your camera's aperture size. The aperture has the same effect on flash as it does any other light. Open up by one stop, say, f/5.6 to f/4, and you've doubled the exposure.
- The ISO sensitivity of your film/sensor. Again, ISO has the same effect on flash as any other light. Double ISO, double the exposure.
- The zoom setting, or beam spread, of your flash. This determines how concentrated the beam is. Zoom to 24mm, and you'll get a lot of spread, but the flash will be less bright. Zoom to 85mm, and the beam will be tight, and brighter.
Your flash will give you a guide number, or GN, measured in meters and/or feet. On the D7000, your pop-up flash has a guide number of 12/39 (fairly typical for an SLR pop-up flash), which means 12 meters or 39 feet. This is measured at ISO 100.
A guide number is the distance at which you'd get a proper exposure if you used a full-power flash, ISO 100, and an aperture of f/1.0.
Remember the inverse-square law, which tells us that flash intensity falls off proportionally to the square of the distance? Conveniently, our aperture settings also follow a square law, since aperture size measures diameter, but the area, proportional to diameter squared, is what determines the exposure)
To use a Guide Number to determine your aperture, first set your flash power to full, and set ISO to 100. Divide the Guide Number by the distance between the flash and the subject. This gives you the f-stop that you should use to get a proper exposure.
For example, if you're shooting a subject 8 feet away with a GN of 39, you need an aperture of f/4.9. If you cut the distance in half, to 4 feet, you need an aperture of f/9.8.
Cutting flash power by a factor of four cuts your guide number in half. Similarly, increasing ISO by a factor of four doubles your guide number. Changing the zoom setting on a speedlight will affect guide number as well.
All this math is inconvenient for the on-the-go shooter, and a lot of it goes out the window when you start using modifiers, bounce flash, etc, so the camera manufacturers came up with Through-the-Lens flash metering, also known as TTL. In TTL flash operation, your camera fires the flash at a reduced power before opening the shutter, known as a pre-flash. The camera uses its metering system to determine how much flash power is needed while the shutter is open.
As you mentioned, the camera doesn't try to "correct" the meter to take flash into account. This is actually a good thing, as it let's you know how much darker the background and any shadows will be, compared to your subject. With TTL flash on, assuming your subject isn't too far away, you always know that it will be properly exposed (at least, according to the camera's meter).
Now, since the shutter speed doesn't affect the brightness of the flash, you can keep your shutter open longer or shorter, depending on how much ambient light you want. Of course, you can get motion blur, etc. An excellent resource on balancing flash with ambient, and all things flash, is the Strobist blog.