We develop a theory of banking that explains why banks started out as commodities warehouses. We show that warehouses become banks because their superior storage technology allows them to enforce the repayment of loans most effectively. Further, interbank markets emerge endogenously to support this enforcement mechanism. Even though warehouses store deposits of real goods, they make loans by writing new “fake” warehouse receipts, rather than by taking deposits out of storage. Our theory helps to explain how modern banks create funding liquidity and why they combine warehousing (custody and deposit-taking), lending, and private money creation within the same institutions. It also casts light on a number of contemporary regulatory policies.