In particular I'm interested in SMD packages. A DIP package I would assume is simply put into a socket and programmed that way.
Of course you could get around this by designing a programmer header into the final product so the code can be uploaded and/or updated, but I know some companies sell pre-programmed chips (suppliers like Digikey offer this option, and from what I've heard you can sometimes contract with the OEM to supply pre-programmed chips). I'm just curious as to how they do this.
I have a two theories, but I don't think either of these are really practical and/or reliable.
Kind of "hold" the pin in contact with pads on a PCB, perhaps even use some sort of latch to ensure a solid contact. This would be similar to how DIP packages are programmed. Would work for packages with actual leads (QFP, SOIC, etc.), but I have doubts as to how well this works for BGA's or exposed pad type packages.
Solder the part into place, program, then unsolder. Seems like it would subject chipsets to unnecessary thermal stress and would use a ton of solder/other resources.