Oracles in the context of smart contracts act as external agents that fetch and verify real-world data or events and feed this information into the smart contract. This allows smart contracts to interact with real-world data, enabling them to execute actions based on data that is not available on the blockchain. Oracles play a crucial role in connecting blockchain-based smart contracts with external data sources, enabling them to make decisions and execute actions based on this off-chain information.