A smart contract is nothing more than computer code thought as a set of rules that get executed every time a type of event happens.
They come with a peculiar set of valuable features such as:
1) AUTONOMY: can be developed by anyone with no need for intermediaries, lawyers, brokers, or auditors;
2) EFFICIENCY & COST SAVINGS by removing intermediaries (efficiency gains);
3) BACKUP: providing a permanent record by allowing auditing, insight, traceability even if the creator is no longer in business;
4) ACCURACY by replacing human intermediaries with EXECUTABLE CODE (hence the process is ALWAYS PERFORMED THE SAME WAY);
5) PROCESSING SPEED: smart contracts can improve the processing speed of business processes that run across multiple enterprises.
Despite the name, smart contracts are not legally binding contracts.
Their main function is to programmatically execute business logic that performs various tasks, processes, or transactions that have been programmed into them to respond to a given set of conditions.
If the code for the smart contract needs an external source to determine if it has met its restrictions, it will use an ORACLE (a source of knowledge).
This would be useful if the smart contract were executing an insurance contract for crops. Following this example, the contract would look something like this: “If the temperature drops below 32 degrees for more than one hour, release $5,000 to John.”
for a more in-depth look at oracles, here’s a comprehensive and well-written article by Patrick Collins: