Blockchain smart contracts in their most simplistic form are accounts that hold a piece of logic (a deterministic computer program) that we can deploy on a blockchain. That deterministic computer program, or code, sits on the blockchain waiting for a message to come in. When that message comes in, the code determines what output to produce. Smart contracts can have a legal meaning but doesn’t necessarily need to have one. They aren’t particularly smart as they are only reactive as they will only do what they are programmed to do. So the term “smart’ is poorly chosen.
Read more here.