Ciao,
the Encoders work just as you wrote, that is, a square wave plus another one out of phase by 90 °.
Inside the Master there is a complex algorithm that counts, understands the direction and eliminates many kinds of mistakes.
For example the two signals cannot change together, if they do this is recognized as an error and corrected.
Here is a generic explanation on Encoders:
https://www.phidgets.com/docs/Encoder_Primer
Here is the theory of the method (with a table of states), that we use to correct errors:
https://www.edn.com/design/integrated-circuit-design/4363949/Decode-a-quadrature-encoder-in-software
The details can be found in the Master firmware that can be downloaded from here:
https://www.theremino.com/technical/schematics#masterv5