They can't. They have to be using exit poll data.
no, they don't.
they know the historical voting patterns in each precinct, who is registered, how they typically vote. as numbers (real votes) come in, they can project the trends based on analysis of that.
now of course, if there is suddenly a "turnout bubble" in some districts, that skews the projections, then it all goes to hell.