In Section 2.5 of Options, Futures, and Other Derivatives (8th edition), there is a paragraph discussing the credit risk associated with the operation of margins:
The whole purpose of the margining system is to ensure that funds are available to pay traders when they make a profit. Overall the system has been very successful. Traders entering into contracts at major exchanges have always had their contracts honored. Futures markets were tested on October 19, 1987, when the S&P 500 index declined by over 20% and traders with long positions in S&P 500 futures found they had negative margin balances. Traders who did not meet margin calls were closed out but still owed their brokers money. Some did not pay and as a result some brokers went bankrupt because, without their clients’ money, they were unable to meet margin calls on contracts they entered into on behalf of their clients. However, the clearing houses had sufficient funds to ensure that everyone who had a short futures position on the S&P 500 got paid off.
The author did not elaborate the reason of "the clearing houses had sufficient funds to ensure that everyone who had a short futures position on the S&P 500 got paid off", under the circumstance that many long positions were not able to meet margin calls. Given that, where did the "sufficient funds" come from? More generally, is the margining system still able to mitigate a party's credit risk when its counterparty's margin balances are negative? If so, how?