Thanks for the responses, but I think I am not expressing myself clearly.
I understand that HIGH means "above a certain +ve voltage" and that LOW means "below a certain +ve voltage (near 0)", but I am curious about how the micro controller knows that a particular pin has a voltage of, say +4.5, or +0.2, attached to it.
When I use an output pin, I can easily detect whether the pin is HIGH or LOW, by connecting a component that acts as an indicator to it (e.g. an LED), or even by measuring the voltage with a multimeter. How does the IC do that when the situation is reversed and it has to determine whether the pin is HIGH or LOW, in other words, how does the IC detect that the pin is connected to a certain voltage range?
I hope that makes sense.