Analog I/O - Just a piece of metal with esd device
Digital I/O - Have logic gates that can control the output mode of the I/O like tri-state and drivers to drive the pin. Contains esd devices as well.
In some microcontrollers you can choose if the pin is digital I/o or analog input. If it is analog input the signal is entered to an internal ADC. The configuration of the pins is done writing the config register of the microcontroller. Take a look for example at PIC18FXX8.