Supposedly based on the precincts that are in. My county splits tickets. There are precincts where a strong Republican will carry 75% of the vote, and precincts where a strong Democrat will get 75% of the vote. If a number of the precinct where a strong Republican gets 75% of the vote are in, and the Republican got 60% of the vote in them, and none of the precincts where a strong Democrat gets 75% of the vote are in, then the folks down at the Court House, from both parties, all know the Republican is toast, even if he is up by 10%.
I don't have any idea how it breaks down in VA, but urban areas tend to report later, and tend to be Democrat.
Of course in my county the larger, more remote precincts, out in the subdivisions, tend to come in late, and the geographically smaller precincts in town near the Court House tend to come in first, so a Democrat up by only 10% with 1/3 of the vote in would be toast.
Urban areas tend to report after they know how many Democrat votes are needed.