doesn't has to /have to [duplicate]
Solution 1:
The rule is that there is at most one tense marker in each clause.
There may be no tense markers, as in the gerund clause going to the Moon or the infinitive clause to go to the Moon; but there can't be more than one.
In I visited the bank the single (past) tense marker is the -ed in visited.
In I did visit the bank the single (past) tense marker is the did (instead of do or does).
It's spread out this way because Question Formation, Negative Formation, and a number of other syntactic rules all require there to be a first auxiliary verb; and if there is no auxiliary verb (i.e, if there is only one verb) in the clause, then they all require Do-Support to provide that auxiliary verb.
Finally, the rules of English grammar require that the single tense marker goes on the first auxiliary verb, or on the main verb if there is no auxiliary verb. That's why it was on the single main verb before Do-Support; but afterwards, it has to go on the new auxiliary verb, which becomes did.
Silly, I know, but that's English syntax for you.
Solution 2:
The easiest answer is "because we do"... that's English grammar!
But perhaps I can offer something that will be more insightful. The following two sentences are equivalent in meaning (if not in emphasis):
I visited the bank. I did visit the bank.
You can mark past tense by placing the main verb in its past-tense form or by using the past-tense auxiliary did. In questions, we usually use the second of these so that we can perform the usual subject-auxiliary swap:
Did you visit the bank?
So to sum up, English allows the past tense to be formed in two ways and your choice of which is dependent on the context.