During the rekeying process, the locksmith removes the lock cylinder from the housing and replaces the pins and springs inside to match a new key. This process ensures that only the new key can operate the lock, while the old keys become obsolete.