Hah, I'd never looked inside one before but that's exactly how I'd imagined it would work.
The optics for a quadrature encoder are very forgiving -- it's much easier to implement than the camera-based sensor that's used for position, which requires a plastic lens.
> I don't understand how to get the stepped motion of the Kensington scroll rings and most mouse wheels. Maybe it has bumps to move past.
Most mouse wheels use a mechanical rotary encoder, and the detents are inherent to that part. Some of the fancier ones use custom mechanisms.