Structural and functional basis of outer-membrane biogenesis