Even though the signal is a sine wave, the pin has an activationthreshold voltage. BeforeBelow this activationthreshold it will be a 0, and afterabove it will read a 1. This is usually a consequence of diodes which pass almost no current until they pass a threshold voltage. Everything below threshold will be blocked from doing anythinginternal circuitry.
AfterAbove threshold, the pin will register a 1. The pin has a range of voltages which it can function regularly in, so even if the voltage of a '1' changes, say from 3.31 to 3.35 volts, during the peak of the sine wave, it will operate in the desired way.
So, the pin goes from not functioning at all,as a 0, to functioning, a as a 1, even though the actual voltage varies slightly. Of Of course, too much voltage and it will begin operating in unexpected ways, usually damaging the chip.