How can we prevent the drifting?
If you journeyed to the end game and ignored the capacitor (because all it does is slow down the inevitable), to ensure that the output of the op-amp remained at 0V (mid-rail), you have to overcome: -
- The input offset voltage problem
- The input bias current problem
- The input offset current problem
Then you have to ensure that these problems remained constant and that they didn't move with temperature.
To overcome the input offset voltage problem, you have to produce a small dc value from Vin equal to the op-amp's input offset voltage. Once you have done this you have to ensure that input bias currents in each of the op-amp's inputs had equal effects. This is usually done by putting equal values of resistors in each connection and, because -Vin has a resistor of "R" then a value of "R" has to be placed in series with +Vin.
Once this is done, you have to cope with the mismatch of input bias currents (called input offset current) and adjust the resistor formerly called "R" by an amount to make the voltage difference that each input resistor produces zero.
After you have done all of this, you have to manipulate the resistors in such a way as to counter temperature changes in these offsets currents and, manipulate the small DC value (from Vin) because input offset voltage also changes with temperature.
If you do all of the above, whether you have a feedback capacitor or not, you will maintain the output at 0V (ignoring noise voltages present at the inputs and long term drift related to aging and mechanical induced hysterisis). You will also have to counteract the effects of resistor values changing with time and temperature as well as the leakage current of the capacitor (and it changing over time).
Why does this happen?
This should be clear now.