How does attaching analog inputs to digital pins actually works?

Same place, at Vcc = 5V. I get V(IL) = 2.2V from the ATmega48A plot you posted.