Capacitor's can act as differentiators, outputting voltages proportional to the *rate of voltage change*. This circuit exploits this behavior to detect edges or input pulses.
The capacitor in this circuit is positive at rising edges of the input (voltage increasing rapidly) and voltage is negative at falling edges (voltage decreasing rapidly). The resistor is used to set the RC time to an appropriate value so the capacitor can return to 0V between edges while simultaneously avoiding excessive current/voltage spikes. Note: the capacitor's voltage is minuscule compared to input/output voltages - increase capacitance to see it more clearly.
The opamp acts as a comparator, comparing input voltages to reference voltage (bottom input, ground). The opamp outputs 5V when input voltage is above ground, and -5V when input is below ground (negative).