i think some of this depends on the car, I know with Saab, if you want a spare key which can start the car, they cut the key to open doors, then they use and existing key and then the new key in the ignition to code it.
this means if you lose all existing keys, you're toast,
they've to replace the existing encoder box (not sure what it's really called) and locks, this is about 1K+.
lost mine key for a while last year, and couldnt find spare straight away after a house move. Saab didn't have an answer as to why they couldn't match the code any other way, all it would take is a db matching the encoder units to VIN no's which main dealers could look up. Told them I won't be buting saab again, as other makers have a lower cost replacement system. Not sure they even cared. The main dealer didn't even figure it out for a week... not an impressive network.