Here's how it works:
1) You buy a game on steam.
2) You download it through steam, and stem updates it fully with all the latest patches and such
3) You run the game
4) If the game requires a CD key, a little popup comes up with the key
5) If you ever need to reinstall, you can right click the game in Steam, and hit View CD-Key to check your key again.