"How did you know?" vs. "how do you know?" distinction

The changing of the tense indicates that, in the case of "did" the fact has been established as true in the past. The truth value having been set, the question is "how DID you (before it was set) know that it would turn out to be true?"

The question phrased in the present tense is a challenge -- the truth value has not been set as of right now (in the present) so the question is "since we haven't ascertained truth, how can you be sure of your assertion?"