Upload & Sell: Off
sounds like you got the gist of it. A dark frame is taken:
1. at the same duration, iso, and temperature** as the light image.
2. The lens or sensor is covered from all light so that all that is recorded by the sensor is the noise.
Subtracting a dark from from an image helps reduce the noise. While a single dark frame may contain some other sources of noise such as cosmic ray hits and such, averaging a bunch of dark frames gives you a better representation of the fixed pattern noise.
One would then use the "master" averaged dark file to subtract from your light images.
**Noise changes with temperature, colder is better. Dedicated astro camera have regulated cooling to keep the sensor at precise temperature. Thus, dark and light frames are all taken at the same temperature. This is not possible with DSLR's but taking dark files on the same night as the images are taken is close enough (and better than nothing).