Encoders

What are encoders and how do they work?