What’s a smart contract?
First of all, it’s a digital contract. It’s lines of code that dictate the rules of the contract. These lines of code are deployed to the general blockchain by the developer and have their own address. When these lines of code are deployed, they can be programmed to no longer have an owner. Therefore, the code is self-enforcing because the lines of code are the only rules and they cannot be changed. The immutability of the contract goes pretty much as far as the immutability of the blockchain itself.
To explain it to a five year told: Imagine if you and five friends sit at a table. You all agree that anything that leaves the hands of someone cannot be changed by someone else (this is due to the cryptographic nature of blockchain). When someone rolls over something to someone else (we’re assuming all money is coins that can be rolled accurately in a direction), nobody else is allowed to grab it (in a blockchain, they can not). Now let’s pretend someone puts a wooden carving sort of like a Thomas the Train train track, with organized rails for when someone rolls a coin into one of the slots on the outside. The person that carved it did it in a way that the rails either point to someone else at the table and/or have doors that open and close depending on whether someone rolled a coin into a certain slot and on a clock on the table. Once the person lays their wooden carving down on the table, they agree not to touch it anymore except by rolling coins at it just like one else. In this way, everyone can see what they’re agreeing to when they roll coins into the carving and nobody can change the agreement once it’s put out.
Applications of this include the sale of tokens that the contract can make up itself, crowdfunding and repayment, and escrow service, for example. As the technology is out longer, further applications for it will likely be invented.