How is a biometric template created on a smart card, and what stops someone from overwriting the card with his/her own biometric?
A biometric template is an encrypted hash of the actual biometric itself. Once created, the template is digitally signed and locked onto the card by the issuing authority. Any attempt to overwrite would not be authenticated by the issuing authority as the smart card prevents modifications of its memory by anyone who is not correctly authenticated.