The position size formula converts a dollar risk and a stop distance into a quantity: size equals risk divided by stop distance.
A wider stop forces a smaller position and a tighter stop allows a larger one, while the dollar risk stays the same. The market's structure sets the stop distance, and the stop distance sets the size.
Formula / example: Position size = account risk / stop distance. Risk $400, stop $2 away gives 200 units