Abstract
How do long-term relationships between banks and firms shape loan pricing and capital allocation? Using administrative data from Mexico's credit registry, I provide stark evidence for an insurance view of relationship lending. When firms repeatedly borrow from the same bank, the pass-through of their default risk to loan rates is nearly zero, and past risk assessments persistently influence credit terms. In contrast, switching to a new bank results in full risk pass-through, consistent with competitive market predictions. I rationalize this evidence in a structural model where banks compete for borrowers by offering optimal long-term contracts. Switching costs sustain commitment to banking relationships, enabling insurance. The estimated model replicates the observed pricing patterns and generates new predictions on when firms receive cheap funding and when they are tempted to switch, which I validate in the data. At the macro level, by strengthening relationships, switching costs enhance capital allocation and recover over 10 percent of welfare losses from financial frictions. However, when embedded in a New Keynesian framework, relationships dampen monetary and fiscal policy pass-through, as banks optimally absorb a portion of these policy shocks.