How does an Analog-to-Digital Converter (ADC) work, and how do resolution and sampling rate impact signal accuracy?