A satellite is sunlit when sunlight reaches it instead of being blocked by the Earth; satellites have no lights of their own, so only sunlit ones can be seen.
Satellites do not glow. What you see in the night sky is sunlight bouncing off their solar panels and bodies. The Planetary Society puts it simply: the ISS's brightness comes from reflected sunlight, not lights on the station.
The Earth casts a long shadow into space on its night side. A satellite inside that shadow gets no sunlight and is invisible, however close it is. A satellite outside the shadow is sunlit. This site checks which side of the line every satellite is on, for every moment it predicts. A sunlit satellite can also flash briefly brighter when a flat panel catches the Sun at just the right angle.
The Sun is not a point but a disc, so the edge of Earth's shadow is soft.
This is why a satellite can vanish in the middle of the sky. When this site predicts that a pass ends because the satellite enters the shadow while still high, the pass card says Fades out mid-sky as it enters Earth's shadow — it will not set, it will simply vanish.
A satellite 400 km up can be in sunshine while you stand in darkness, because from that height it can ‘see’ over the curve of the Earth to a Sun that has already set for you. That is the window that makes satellite-spotting possible: after sunset and before sunrise. Late at night, the shadow catches up with low satellites, and they go dark — see why satellites are visible only at dusk and dawn.
Look for pass cards with the note ‘Fades out mid-sky as it enters Earth's shadow’ — those passes end when the satellite stops being sunlit. See satellites visible tonight
The site's shadow test (getIlluminationState) is a conical model that compares angles as seen from the satellite:
If θ < θE − θS, the Earth covers the whole Sun: eclipsed (umbra). If θ < θE + θS, it covers part of it: penumbra. Otherwise: sunlit.
The Sun's position comes from a low-precision formula (from the Astronomical Almanac, as the code notes) for the Sun's ecliptic longitude and distance, accurate to about 0.01°.
Worked example for the ISS at |r_sat| = 6,378 + 420 = 6,798 km. θE = asin(6,378 / 6,798) = asin(0.9382) ≈ 69.8°. The Sun's angular radius at 1 AU is about 0.27°. So the ISS is fully eclipsed when the Sun is within about 69.5° of the direction straight down — and sunlit when the Sun is more than about 70.0° from it.
The same geometry tells you how long after sunset a satellite overhead stays lit. For a satellite at your zenith at height h, sunlight still reaches it until the Sun is about arccos(R / (R + h)) below your horizon: for h = 420 km, arccos(0.9382) ≈ 20°. So a satellite overhead at 420 km stays sunlit until the Sun is roughly 20° below your horizon — well after the end of astronomical twilight at 18°.
It flies into Earth's shadow. With no sunlight to reflect, it becomes invisible even though it is still above the horizon.
In the umbra the Earth blocks the whole Sun, so the satellite is dark; in the penumbra it blocks only part of the Sun, so the satellite is dimmed.
Yes, if it is high enough, because from far above the Earth it can see past the Earth's edge to the Sun. Low satellites like the ISS, however, are usually in shadow around local midnight in India.