Imagine you have a strategy and you found that the optimal risk you should take is 4%. In other words with this strategy you should put 4% of your capital at risk in every trade to grow your account the fastest. If you enter a trade with 100% of your capital, the SL % is the % you put at risk. NOT the whole position size. So by entering a trade with all of your money and setting a 4% SL you only put 4% of your money at risk at all times !
Now let's examine the following situation keeping our strategy in mind. Imagine a perfectly oscillating market (for demonstration only). We are at the point where the red line ends and we expect the price to go the dashed path with a very high certainty. Our optimal & desired risk is 4%. However in this trade that we want to enter rightnow we can set a stop loss tighter than 4% because we are very certain that it wont be hit. So we can use a 2% stop instead. If you now put 100% of your capital in this trade you only put 2% of our money at risk at all times. However we want to put 4% of our money at risk for the best returns possible taking optimal risk (4%). That's where leverage comes into play as a LEGITIMATE tool and not a gambling tool. You already have 100% of your money in this trade, you can't put in more (without leverage) although your risk management tells you to do so. You want to increase your risk from currently 2% to 4% = double it. This means you have to take a 2x leverage. Now you are 200% invested in the trade and if your stop loss of 2% (in price action) gets hit you will lose 2 x 2% = 4% which is the optimal risk we wanted.