It isn't exactly a loan. It works basically like this:
http://www.babypips.com/school/lots-leverage-and-profit-and-loss.htmlTypically the broker will require a trade deposit, also known as "account margin" or "initial margin." Once you have deposited your money you will then be able to trade.
For example, if the allowed leverage is 100:1 (or 1% of position required), and you wanted to trade a position worth $100,000, but you only have $5,000 in your account. No problem as your broker would set aside $1,000 as down payment, or the "margin," and let you "borrow" the rest. Of course, any losses or gains will be deducted or added to the remaining cash balance in your account.
If your margin balance drops too low all your positions are liquidated. It basically allows you to increase your return or your loss from trading.
It would be pretty risky with how volatile the current market is but some people might be into it.