error amplifier is just an differential operational amplifier. comparator is just a level comparison hardware i.e. if input voltage is below some value, o/p is zero, otherwise ouput is Vcc.
By differential operational amplifier means, the op-amp in differential amplifier mode, the error signal is generally comparison of two voltages which is applied to two inputs of op-amp, op-amp will cancel out the common mode voltage and will amplify the difference of two.
According to ur circuit, the output of EA is the difference between Vref and Vout, its circuit where u want Vout = Vref. So, the error signal is amplified and sent to PWM control to increase or decrease duty cycle of PWM to increase or decrease the average voltage.
Find current sense circuits on google, u will get better idea of error amplifiers.