The stock market merely reflected the balance sheets of large financial institutions. The stock market drop did not cause Bear Stearns to go bankrupt, Bear Stearns being bankrupt caused the market to collapse. That triggered enough insurance policies that AIG went (or would go), and GS had enough insurance with AIG that it would go if AIG went.