A smart contract is a piece of code that operates on an “if this then that” principle to automate certain actions.
A complete contract would specify what should happen under every possible scenario. An incomplete contract is one that may require renegotiation should an unexpected event occur. Clearly, complete contracts are difficult and complex to appropriately define. Some economists have theorized that this goes, at least someway, to explain why some transactions (those for which it is hard to define a complete contract) occur internally within organisations and others (those for which a complete contract can be defined) are able to occur in external markets.
Smart contracts are a way of lowering the transaction costs of incomplete contracts. As a result they facilitate the expansion of economic activity that can now feasibly take place within markets.