What happens with corporate deposits when a bank goes bankrupt? When a bank goes bankrupt the money of the private individuals who saved in that bank are lost but a part of the money are guaranteed by the government.
But say for example Apple has 10 billion dollars in an account at Bank of America and BoA goes bankrupt.
What happens to Apple then? Can they get their money back?
In simplified terms a bank or shadow bank (non-bank financial intermediary operating a balance sheet similar to a bank balance sheet) holds a mix of cash, marketable securities, and investment portfolio on the asset side of the balance sheet. The bank or FI issues a mix of equity, insured liabilities, and uninsured liabilities on the liabilities and equity side of the balance sheet. If the bank or FI is forced to write-down the value of assets in the investment portfolio then the creditors holding equity are forced to take the first loss and the creditors holding uninsured liabilities take the remainder of the total loss. Sometimes uninsured liabilities convert to equity in a new venture carrying the good assets or there is a bailout via government recapitalization effort in a systemic crisis.
These are FAQs describing the resolution of IndyMac Bank via the FDIC:
https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/indymac-q-and-a.html#Uninsured


If it is determined that you have some uninsured funds, the FDIC will mail you a Receiver Certificate.  This certificate entitles you to share proportionately in any funds recovered through the sale of the assets of IndyMac Bank.  You will eventually recover some of your uninsured funds.  Of course, you will receive immediate full payment for your insured amount by transfer to IndyMac Federal Bank or from your broker.  In addition, the FDIC will pay uninsured depositors an advance dividend of 50% of your uninsured deposit.


Large cash investors seek secure liquid investments and cannot rely only on insured deposits for this purpose. See Institutional Cash Pools and the Triffin Dilemma of the U.S. Banking System by Zoltan Pozsar (2011):
https://www.imf.org/external/pubs/ft/wp/2011/wp11190.pdf

Institutional cash pools prefer to avoid too much unsecured exposure to banks even through insured deposits. Short-term government guaranteed securities are the next best choice, but their supply is insufficient. The shadow banking system arose to fill this vacuum. One way to manage the size of the shadow banking system is by adopting the supply management of Treasury bills as a macroprudential tool.

Warren Buffet testified to the Financial Crisis Inquiry Commission (FCIC). There is an audio copy online. As I recall he describes having to make an $8 billion payment in the fall of 2008 during the financial crisis. He said Treasuries were the best option at the time to ensure the cash would be available to make the contractual payment obligation.