Some key codes relate directly to the bitting depth - ie how many tumblers or leaves in the lock, and how deep each one is on a set scale (often 5 or 6 different depths).
Other codes aren't written so basic, and need a lookup table to ascertain the code. From my experience with Commodore keys, which evolved from HQ keys, these tables are published to locksmiths and dealers, and there's something like 6-8 pages of them. There's simply not enough paper to list every code, but the tables explain how the letter comes into it, and how to extrapolate the 5-digit bitting code from the key code.
I remember learning about this back in 1993 with my father's VK. I'd driven it over to a mate's place for a weekend BBQ/party.
The key (a cut copy made from brass) got bent when unsuccessfully fielding a backyard cricket catch, and broke when I tried to straighten it.
By good fortune, the father of one of the guys there (his neighbour) was a locksmith, with the full kit in the back of a van.
We took the 2 bits of key to him, and he shook his head, but asked if we had the books for the car.
He looked up the key number, went to his workshop, and came back with the cut key, ready to go.
He explained the key cutting matrix system to me - ie basically a grid of length & depth to position each cut, and some of the intricacies - like you can't have a real shallow cut beside a real deep one. and how a worn lock or key can allow many "near" combinations to operate it. He was one of those old school guys Terry mentioned - and as typical with older tradesmen, they love to share their knowledge to anyone from a younger generation who shows interest.
I found this page that covers similar locks to the HQ, used in US GM cars:
http://www.camaros.org/keysandlocks.shtml