Gaps are created after a period of inactivity of the market, for example, after the weekend when the market was closed, the market can open at a much higher or at a much lower price than the closing price.
With gaps comes a high volatility of the market price, thus creating a risk for traders.