Concept Flow - msg.value and msg.sender
Transaction sent
msg.sender set to sender address
msg.value set to sent ether amount
Function executes using msg.sender and msg.value
Contract updates state or transfers ether
Transaction ends
When a transaction calls a contract, msg.sender holds the caller's address and msg.value holds the amount of ether sent. The contract uses these to process logic.