During Bitcoin Script execution, what is the significance of the signature verification in the stack? During execution of the script i.e. ScriptSig + ScriptPub , the last step is the verification of the Signature against the public key provided by the recipient. How does this work and what is the significance of verifying two entities which belong to the same user?
How does this work


Bitcoin uses the Elliptic Curve Digital Signature Algorithm. The algorithm is described on Wikipedia (linked). Bitcoin specifically uses the secp256k1 elliptic curve.


  what is the significance of verifying two entities which belong to the same user?


There are not two entities.

The signature proves that the owner of the private key which corresponds to the public key created the signature over a given message. In the case of Bitcoin, the message is the hash of the transaction (excluding the signatures themselves because they don't exist yet). This ensures that the person spending the output is allowed to do so and ensures the integrity of the spending transaction itself.