Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. They automatically execute and enforce the terms of a contract when certain conditions are met, without the need for intermediaries. Smart contracts are often used in blockchain technology to securely facilitate and verify transactions.