The private key cannot be derived from your signature. The signature is stored locally in a client or browser extension or another signer app.
Sorry but I’m not going to explain further. If you truly want to know how it works, search engines are your friend. Look up how nostr signing works and look into cryptographic signatures.