Leverage is often presented as an advantage, but it is an amplifier: it multiplies both gains and losses. Understanding margin helps you avoid losing your account through over-exposure.
What margin is
It is the collateral the broker locks from your account while the position is open. It is calculated as the position value divided by leverage, and it is released when you close.
Example with EUR/USD
One lot of EUR/USD with the price at 1.10 has a value of 110,000 USD. With 1:100 leverage the margin is 1,100 USD; with 1:30 it is 3,666.67 USD; with 1:500 it is 220 USD.
Leverage does not change the pip value
On that same lot, each pip is worth 10 USD at any leverage. What changes is how much margin is locked and how many positions you can open. High leverage does not make a trade more dangerous by itself; what makes it dangerous is opening lots that are too large for your account.