The adverb 'how' relates the objective complement of the verb 'know'.
How do you know how to fly? *You know that(=how to fly) how?
The adverb 'how' in front position relates to the main verb 'know', the other 'how' in the noun phrase to 'to fly'.
I hope this helps.
Student or Learner