Suppose I have 100 million in my investment portfolio and a 5% interest rate. I want to buy a house for $10 million. So I withdraw 2 million in cash and get a margin loan for 2 million so I don't have to sell any securities. I take the 2 million in cash, get a mortgage for 8 million, and buy the house. On average the market returns 7%. So my $100 million portfolio is earning $7 million per year less the loan interest of 100k which comes to $6.9M. After 2 years I pay off the mortgage and repay the margin loan. I now have a house and I didn't have to pay any taxes on my securities to buy it.
What if the market goes down? Well, I just wait for it to go back up again. I can easily afford to wait, my margin of safety is huge. Since the margin loan is for 2 million, and I need a 50% margin of safety by law, then the portfolio value would need to decline to 2 million (98% decline) before my loan gets called.