Grasshopper, you have failed me!
Cepheid variables are very YOUNG stars; pre-main sequence if you will.
THe variabilty of the Cepheid is a result of the cyclical ionization of He in the star's atmosphere; when it get's hot enough, the ionized He renders the stellar atmosphere more opaque, thus reducing the energy flux, and hence the luminosity of the star (it gets dimmer). But this means energy is building up in the star, and the increased pressure expands the atmosphere, which must cool off as a result of the expansion. This allows the He to "un-ionize," reducing opacity, and consequently increasing the luminosity (star gets brighter). After blowing off the excess energy, it contracts, increasing the temperature, reionizing the He, and the cycle repeats itself.
THe cycle time (period of variability) is related to the mass of the star, and the mass of the star is ALSO directly related to it's luminosity, and hence it's absolute magnitude; thus, we can obtain a relation between the star's period of variability and it's absolute magnitude. Thus, if we can measure the period of variability and the apparent magnitude of the star, we can calculate the distance it must be from us, as we can calculate its absolute magnitude from the period of variability.
Wait a minute! Havok said that since we haven't been there, we couldn't possibly know how far it is to any star!
Oh, wait, he was just wrong again.
Well, I've blundered before. No doubt I will again. I do it all right out in the open, for everyone to see. PH goofed!