Mental Model: Programmable Money
The simplest transaction a user can submit to a blockchain is an "empty transaction", which encodes no desired database changes. Even an empty transaction initiates the database update of incrementing the user account's nonce.
One step up in complexity, a user can specify a "value" and "destination account" in their transaction. This encodes the database update of subtracting the balance of the user's account by the specified value amount (plus the transaction fee in native tokens), and adding that exact same value amount to the balance of the destination account. This is a transfer of balance.
One more step up in complexity is when a user additionally specifies "call-data" in their transaction. In addition to balance and nonce, each account also has associated code and storage values:
code: the executable bytecode of a program.storage: the account's own internal key-value database, used as a persistent data store for the program.
When a user submits a transaction with call-data directed at an account that has code, the program executes. Based on the inputs supplied by the user as call-data, the program can make updates to its own account storage, to the storage of other accounts (so long as those accounts' code permits it) and transfer balance between accounts. By signing this transaction, the user authorizes whatever state changes the program's execution produces.
Why this is powerful
The rules of a program are stored as code in the blockchain database. Every node in the network executes the same code on the same inputs and arrives at the same state changes. No single party can alter the rules — they are enforced by the blockchain's properties of permissionlessness, trustlessness and immutability.
Since account balances have real monetary value, a program that moves balances between accounts according to fixed, publicly auditable rules is, in effect, a financial contract — enforced not by an institution, but by the blockchain's network of independent nodes.
These programs can encode rules far more complex than simple transfers. For example, a program can let users deposit native tokens and exchange them at a rate determined by the program's own rules. This is a currency exchange, operated by no single party, whose rules and execution are publicly auditable by anyone. This forms the basis for blockchain applications like currencies, exchanges, lending, and more.