How playing it safe contributed to the 2008 crisis

Why do banks usually invest in assets where the risk is lowest? And how did this contribute to the subprime boom during the financial crisis?