Why is there a capacitor in the feedback path of a comparator, why is there a resistor on the input?
It's explained in Negative feedback capacitor in Op-Amp comparator circuit. R2 and C1 decrease the high-frequency gain of the comparator, so it won't rapidly flip between V+ and V- when the input is near the threshold.

Edit: I've looked at the circuit some more, and I think a comparator is the wrong way to think about it. In steady state, it won't be fully on or off, but in the middle. The transistor will be partially turned on to hold the supercapacitor voltage around 2.654V. It's only if the voltage is significantly too high or low that it will act as a comparator.

In more detail, it's an op amp integrator acting as a voltage regulator. It integrates the error signal (difference between the capacitor voltage and the reference voltage). If the capacitor voltage is too high, the integrator will slowly turn on the transistor, pulling the voltage back down. It should reach a level where the error is zero and stabilize. If the voltage is too low, the integrator output drops, gradually turning the transistor off.

For your original question, R2*C1 controls how fast the integrator will change; without R2 it wouldn't integrate and would act as a simple comparator.