Developers can write the smart contract lines of code using the native language of a blockchain system. In Ethereum, developers use the Solidity native language. The contract codes can be used in various kinds of applications such as transferring money when certain sets of conditions have been met.

Once the code has been written, it is uploaded into a runtime compiler or a browser that will execute the smart contract code. In Ethereum, a code will be uploaded to the Ethereum Virtual Machine-EVM. After the code has been uploaded, it will be uniform across all the nodes in the blockchain network because it is operating in a decentralized peer-to-peer network. Each and every node will attempt to execute the code to determine whether the conditions or contractual requirements have been met.

Contracts on a smart contract system are generally powered by a digital asset. After the contract has been successfully executed, the digital asset is distributed or redistributed according to the terms that have been stipulated in the contract.

More detail: https://www.linkedin.com/pulse/what-smart-contract-michael-greenwood/