How to control output voltage on a Buck Converter
There is an error amplifier in the regulator that controlls the pulse width of the signal
 that turns the output mosfet on and off.  The datasheet should tell you what that is.  You use the resistors divider so that  voltage fedback to the control loop is the "error voltage"  when the voltage is at the output level you are trying to achieve.