Essays on financial stability and the industrial organization of the banking system