A quadrature encoder is a way of building a shaft encoder capable of determining speed and direction. They have two channels, each of which is, at any moment, a logical one or a logical zero. Thus, the two channels divide a full circle into four pieces, hence quadrature.

The output of a quadrature encoder looks something like this:
   
    1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

   +   +---+   +---+   +---+   +---   
A: |   |   |   |   |   |   |   |
   +---+   +---+   +---+   +---+      

   --+   +---+   +---+   +---+   +-   
B:   |   |   |   |   |   |   |   |
     +---+   +---+   +---+   +---+

Thus, the circuit/program tending to the encoder must notice transistions from one state to another. When it sees a 1->2 transition, for instance, it knows that the shaft has just rotated forward; when it sees a 3->2 transition, for instance, it knows the shaft has rotated backwards. What it does when it encounters, say, a 4->2 transition is left as an exercise for the reader.