Buying stock on margin is when you buy it without paying the full price. A individual who buys on margin pays a small percentage of the stock's price and borrows the rest of the money. The individual hopes that the stock price will rise, helping them to pay off the loan.
People were able to pay inflated rates for stocks because they were buying on the margin and were overconfident about the stocks' prospects. The bubble finally burst, and stock prices plummeted. As stock prices plummeted, anyone who had borrowed to buy on margin was in deep trouble. They went bankrupt after they were unable to repay their loans. Banks struggled as a result of the failure of too many people to repay their loans. Much of this led to the Great Depression.