The component shown is a rotary encoder. These put put a pair of waveforms that are referred to as quadrature signals (two square wave signals that are shifted a quarter cycle from each other). The signals look like this:
The benefit of having the two signals is that you can detect which direction the encoder is being turned. The speed at which the encoder turns is detected by the frequency of the square waves.
User interface encoders come in all sorts of styles. Big one that can take a knob like the one pictured in your posting are suitable for some applications. There are also small types like pictured below can provide a lot of functionality in a small space.
This little guy is about the size if a USA penny coin.
The outer ring rotates to produce quadrature waveforms. The outer ring can also be pressed in the N, S, E and W directions and provide contact closures for each. The black center dimple can also be pressed to produce a fifth contact closure. Such device can actually support a whole user interface scenario without any additional user switches.