The key can be generated on the smartcard, and it's not possible to transfer it out of the smartcard by design.
(anything that calls itself a smartcard but allows this isn't a smartcard)
If it's a properly designed smartcard system then the key never leaves the card.