If you go to the hardware section of arduiono.cc and look up the various arduino schematics, you can see that, on the deumilanove for example, analog pins A0 thru A5 are ATMega pins 23-24-25-26-27-28, which go out to the header connector. If you call them inputs/outputs 14-19 when assigning them in setup(), the compiler does the background work select the internal circuits to make them digital pins vs analog pins.