I am currently learning solidity for writing smart contracts. I understand smart contracts are stored on the Ethereum block chain and broadcast and exectued by all the nodes on the network. google: A smart contract refers to a piece of computer program that gets executed by a quorum of blockchain nodes independently in order to record the latest program state.
This is where I am having a bit of problem understanding the execution cycle. Let's say we are doing something that happens only once, exchanging an ERC20 token for ETH for example. Take Node A and B. Node A exectues the transfer and does the transfer, say for example. When Node B executes the code, there will be a check on the balance in the smart contract or something, but does it even get to this point. Is the actual smart contract really executed more than once or is it done once and the other executions are somehow different?
confused since we are writing a contract which does an action one time but gets executed multiple times , thanks for links to other readings.