This dissertation contains theoretical essays on financial intermediation and regulation. The main theme is the optimal regulation of banks, particularly capital regulation. The key question analyzed is how regulation affects the competitive dynamics of the banking industry, and, vice versa, how competition affects the effectiveness of capital regulation. These issues are analyzed in an industrial organization (IO) setting allowing for inter-bank competition and new entry. The most striking finding is that increasing costly capital requirements can lead to more entry into banking, essentially by reducing the competitive strength of lower quality banks. Other issues analyzed in the dissertation pertain to why banks combine lending and deposit taking, and how inter-bank competition affects the characteristics of an optimal loan contract. The dissertation also includes a review chapter on the foundations of banking, including rationales for regulatory interference in this industry. The latter also culminates in a public policy chapter on the design of regulation.