At the top if the picture there is a 5.00V power supply that makes VREF. (right side) Every thing is based off the is 5.00 volts.
Left side there is a amplifier 0.5. It outputs 1/2 of VREF or 2.50 volts. (goes to error amp)
The error amplifier looks at two things (2.50V) and (FB pin)
The FB pin looks at the output of you power supply. If you want 10 volts out then take two resistors and make a 4:1 divider. This way when Vout=10V the FB voltage will be 2.5V.
The error amp compares the 2.50V from Vref and compares ti to 2.5V that came from the output voltage.
Normally there is a capacitor from FB to COMP. This makes the error amp slow.
see more below:
Start at power up. Vref is 5.00V and 2.5V is good. The output is 0V because we are just starting out.
The error amp sees that 2.5V does not equal 0V so it starts moving COMP up which causes the duty cycle to move from 0% to 10% to 20% to 30%. The output voltage will start at 0V and move up 1V to 2V to 3V......
In our example when the output is at 10V the FB voltage will be 2.5V. Now 2.5=2.5 and the amplifier will hold (not up or down). The duty cycle is what is needed to make 10V.
If the load goes away and the voltage goes up to 10.1V then FB=2.525V (2.50 does not equal 2.525) so COMP moves down, causing the duty cycle to get smaller and reduce the output voltage.
---------------------------
Error amplifier: it amplifiers error!
It compares a known voltage (2.50V) and a unknown voltage (10V/4=2.5V). If there is an "error" it makes the error bigger.