An oxygen molecule does some chemical reaction on the sensor electrode that releases an electron, maybe it's made of iron and turns into rust. If you supply the same current to another electrode to do the opposite reaction, maybe one made of rust that turns into iron, it balances.
The sensors must be consumable with a certain lifetime.