Smart contracts can only access the data available on the blockchain, we call this on-chain data.
Sometime, contracts may need data that are not on the blockchain, for example we may want the price of the Sushi token on different centralised exchange so we can compare it with sushiswap price.
Contracts can only fetch on-chain data, this means we a contract that return the Sushi price and will be frequently updated to stay accurate.
But how to make sure the price returned by the contract is the good one ? who will update it ? how to make sure it is not lying or giving a wrong price ?
Meet oracles.
An Oracle like ChainLink is a network of nodes that manage and aggregate different contracts containing off-chain data, can be tokens prices, weather, randomness or many other things.
The accuracy of the data is achieved by aggregating the data from many nodes with transparent monitoring of their historical behavior.
When an oracle submit data on-chain, this data is kept forever thus we can see if a node have been resilient and acting as expected since its creation.
With this system we can ensure data is correct and use it in any DeFi applications (ex: Kashi).