You are thinking of what happens when people do stupid things such as “buying on margin”.
Buying on Margin, is basically taking a loan, but you are getting the loan from the brokerage, not a bank.
People do this so they can buy more stocks than they can afford.
Typically you are allowed to borrow up to 50% of the purchase price of a stock. So I deposited $20k, and now I can buy $40k worth of stock. They also have a minimum of equity that is required in the account, this is called the maintenance margin. Let us pretend the maintenance margin is 25%, and I borrowed to my limit and got all $40k.
My equity is [$40k (Stocks current value) - $20k (Amount Borrowed)], so I have $20k in equity, and $20k equity is 50% of the $40k stock value, well above the 25% minimum.
To calculate the stock value I absolutely must keep in this account, the formula is :
[$20k (Amount Borrowed) / 75% (1 - Maintenance Margin%), which = $26,666.66.
You can also see that $26.67k (stock value) - $20k (amount borrowed) = $6.67k, and $6.67k / $26.67k = 25%, the absolute minimum of equity i can get away with.
If it falls below 25%, the bank can do what is called a margin call. This means that you must immediately deposit more money to make up the difference, or the brokerage can sell off your stock. Lets pretend the stock plummeted to $24k.
$24k - 20k = $4k / $24k = 16.667%, big oops. Margin call time. Im required to keep it at 25% of the $24k, which is $6k. Therefore I must immediately deposit $2k or the brokerage will sell off my stock.
Here is the kicker, the brokerage does not have to inform me of this, and in fact can immediately sell my stock the second this occurs. Even if this stock just had a bad day, and went up to $30k an hour later thanks to some huge announcement. They just liquidated enough stock to pay back the $20k loan, now I only have $4k left. And remember, I put down $20k of my own money, I’m now down $16k. Stonks
Here is the even more nightmare scenario. The $40k in stock dropped to $25k today, triggering the margin call. But brokerage didn’t tell me, and this price keeps dropping and dropping and dropping. The brokerage decides to sell, but now the value of it is only $12k. I not only just lost $20k of my own money, I now have to come up with $8k more to pay back this loan.
Edit: I can’t believe I just spent an hour writing this