Over the weekend, UBS (UBS  ) took over Credit Suisse for more than $3 billion as Swiss regulators organized the largest banking deal in years in effort to stabilize the global banking system.

The marriage between the two rival lenders, who both operate on a global scale, comes as the Swiss government agreed to deposit more than $9 billion to ease some losses UBS may take on as part of the takeover. The Swiss National Bank will also make more than $100 billion available to UBS to support the bank's liquidity.

UBS Chair Colm Kelleher said the acquisition is "attractive" for the bank's shareholders as the resulting combined bank will have more than $5 billion in total invested assets and "sustainable value opportunities," but stressed that "as far as Credit Suisse is concerned, this is an emergency rescue."

So what led Credit Suisse to need an emergency rescue?

The 167-year-old Swiss lender's major trouble began last Wednesday after its largest investor Saudi National Bank said it could not give more money to the bank. However, its decline started earlier, with Credit Suisse's shares beginning to decline in 2021 following the collapse of investment fund Archegos and Greensill Capital, Reuters reports.

In July, new CEO Ulrich Koerner unveiled a strategic review that failed to encourage investors, with the lender confirming in February that clients had pulled $119 billion from the bank in the fourth quarter as the bank suffered its biggest annual loss of since the financial crisis at $7.91 billion.

The collapse of Silicon Valley Bank and its reverberations across the global banking sector also did not help instill confidence in the health of Credit Suisse. During the recent financial sector turmoil, the bank suffered as much as $10 billion in customer outflows per day last week, a source familiar with the matter told The Wall Street Journal.

Unlike SVB, whose business is concentrated regionally and mainly in the tech start-up industry, Credit Suisse operates on the global stage, and its collapse could have led to more turmoil for the broader world financial system.

"We have structured a transaction which will preserve the value left in the business while limiting our downside exposure," Kelleher said in a statement. "Acquiring Credit Suisse's capabilities in wealth, asset management and Swiss universal banking will augment UBS's strategy of growing its capital-light businesses."

Kelleher added that UBS would shrink Credit Suisse's investment banking business to better align with the bank's "conservative risk culture."