Often Hyperledger Fabric users use the terms smart contract and chaincode interchangeably. Lets first understand what a smart contract is:

A smart contract is a computer protocol intended to digitally facilitate, verify, or enforce the negotiation or performance of a contract. Smart contracts allow the performance of credible transactions without third parties. These transactions are trackable and irreversible. — Wikipedia

Let's deduce this in simple language — a contract can execute on its own if it satisfies the terms of the contract without any interference from a third party.

In Hyperledger Fabric:

A smart contract defines the transaction logic that controls the lifecycle of a business object contained in the world state.

Too technical? Let's simplify it. Let’s take an example of a Car whose owner is Alice. The object is Car and it is saved in the World State.

World State stores the latest state of any object while the blockchain stores all the history of the object from its creation to its current state.

Now, Alice wants to sell this car to Bob.

Alice will initiate a transaction proposal to change the ownership from her to Bob.

The smart contract will change the ownership of the car in the world state according to the transaction logic.

In Fabric, a smart contract is packaged into the chaincode and then chaincode is deployed to a blockchain network. For simple understanding, you can think of chaincode as the superset of the smart contracts.

Multiple smart contracts can be defined within the same chaincode.

There can be a chaincode for a Vehicle and it can have multiple smart contracts such as Car Contract, Bike Contract, and Truck Contract.

draw.io

Every chaincode has an endorsement policy associated to it while deploying it on a blockchain network. This endorsement policy will apply to all the smart contracts defined in it.