How is a pin designed to be analog or digital on a Arduino/Raspberry Pi board? I don't mean what is the difference between analog or digital, or what functions do I need to use to write an analog/digital signal. I mean on one of these boards, certain pins are called "analog" pins and unlike digital pins, the analog pins can detect more values than just "ON" and "OFF." How is this feature implemented on the circuit board (i.e. the hardware)? Does the chip on the board have something to do with it? Where can I learn more about this?
Those analog pins has an ADC embedded in them. Generally, a single pin is connected to a lot of Peripherals, the GPIO (General Purpose Input Output) peripheral is responsible to give a digital output or digital read. Most of the pin has GPIO MUXED in them.Other example of peripherals are PWM, CAP etc. For Analog read, we have ADC peripheral. The number of ADC peripheral are limited in number, but single ADC has multiple channels, which means the ADC can only convert one channel at a time.
You can learn about them from their respective Datasheets and Technical References.