This was because big global banks held each others heavily insured risky assets.
Depth and calamity of the collapse was entirely due to leverage. If it had ONLY been the ratings agencies over rating the quality of the securitized mortgages, there would have been a huge dip in the market, and it would have sorted itself out. If it had ONLY been a bunch of mortgages going bad, the markets would have dipped, and recovered. The problem was the "credit default swaps" which were basically insurance policies that got sold over and over. They weren't treated as insurance, so the companies selling them weren't regulated to have enough capital to back them.
Think of someone buying an insurance policy. They lie on the application and they are months from death. The company sells them a low cost policy not knowing they are going to die soon. Maybe the doctor was involved. It was a sale based upon a fraud. Now suppose that hundreds of policies got sold because of this doctor. The insurance company is in a bit of trouble. They might even fail if the fraud is too broad. Okay, the system actually can handle that. Now, suppose that people began to figure out that the doctor was full-o-crap. So THEY buy policies on the sick people. The insurance companies problem is getting bigger. They might even sense their risk. So they securitize these policies and sell them to other companies. Now other banks and institutions also hold these risks. Worse, now they are sold on stock markets where their price can climb, increasing the risk. Pretty soon, these failures can be magnified 40 times. That can cause a collapse.