How does this filter work?

As pointed out in my comments the inverting input is a virtual 0V so the gain of this circuit is :

$$Gain = -\dfrac{Z_f}{Z_i}$$

Where \$ Z_i \$ is our input impedance \$ R_1 \$ in series with \$ C_1 \$

$$Z_i = R_1 + \dfrac{1}{j \cdot \omega \cdot C_1} = \dfrac{1+ j \cdot \omega \cdot C_1 \cdot R_1}{j \cdot \omega \cdot C_1}$$

And \$ Z_f \$is the feedback impedance, taking your second example \$ Z_f \$ is \$R_2\$ in parallel with \$ C_2 \$.

$$Z_f = \dfrac{R_2 \cdot \dfrac{1}{j \cdot \omega \cdot C_2}}{R_2+\dfrac{1}{j \cdot \omega \cdot C_2}}= \dfrac{R_2}{1+ j \cdot \omega \cdot C_2 \cdot R_2}$$

$$Gain = - \dfrac{Zf}{Zi} = - \dfrac{\dfrac{R_2}{1+ j \cdot \omega \cdot C_2 \cdot R_2}}{\dfrac{1+ j \cdot \omega \cdot C_1 \cdot R_1}{j \cdot \omega \cdot C_1}} = - \dfrac{j \cdot \omega \cdot C_1 \cdot R_2}{\left( 1+ j \cdot \omega \cdot C_1 \cdot R_1 \right) \cdot \left( 1+ j \cdot \omega \cdot C_2 \cdot R_2 \right)}$$

This gives you zero gain at DC raising until the first pole where it levels out then falling at the second pole.

The poles being when \$ \omega \cdot C_1 \cdot R_1 = 1 \$

and when \$ \omega \cdot C_2 \cdot R_2 = 1 \$

This answer is a lot more mathematically rigorous than the one by @DaveTweed but that doesn't make his answer any less correct.


Consider the total impedance of R1 and C1 in series.

If the frequency is high enough so that the capacitive reactance is significantly less than the resistance, the total is dominated by the resistance — essentially constant. The gain of the circuit (feedback impedance over input impedance) is essentially flat.

On the other hand, if the frequency is low enough that the capacitor's reactance is greater than the resistance, it is the reactance that dominates. This impedance rises with decreasing frequency, which means that the gain of the circuit decreases — a high-pass effect.

For the second part, you can make essentially the same argument for C2 and R2, but in this case, since it's a parallel connection, the smaller of the two impedances dominates, and since it's in the feedback path, a decreasing impedance with increasing frequency results in decreasing gain — a low-pass effect.