A margin call happens when your free margin (the balance that has not been used for loans or trades) gets below 10% of your used margin. For example:
Balance = 100 USD
Margin Used = 50 USD
Profit & Loss (P&L) = -48 USD
Free Margin (Margin Available) = Balance + P&L - Margin Used = 100 + (-48) - 50 = 2 USD
In this example, free margin is 2 USD or 4%. A margin call will be issued.
As you might have noticed, margin calls tend to happen when P&L gets too far in the negative. When a market is being volatile, your P&L can go from positive to negative in a matter of seconds. To prevent this situation, you can set a Stop-Loss limit.