"I have to flee."- present
"I had to flee" - past tense
"I had had to flee" - past perfect tense.
I note you didn't ask about the use of the past perfect in the first line. Simple past would be "He was defeated". The writer could have used the simple past in the second line, but he decided to continue with the past perfect.
Student or Learner