My question is as the title.
What are the differences between ''how did you know '' and '' how do you know''??
Is there a different meaning for each phrase ?
When you use "did" you are referring to a time in the past.
The person probably still knows it now, but he or she knew it in the past as well -- at some point in time that was important or the time being discussed.
You may also use "did" for reported speech, which usually shifts the tense back.
I'm not a teacher, but I write for a living. Please don't ask me about 2nd conditionals, but I'm a safe bet for what reads well in (American) English.