During the Dragon War, a Dragon Priest known as Miraak somehow stumbled onto Apocrypha and met Hermaeus Mora himself. Hermaeus Mora taught Miraak the Bend Will shout, which the Dragon Priest used to rebel against the Dragons, which ultimately resulted in his imprisonment in Apocrypha. He has served the Daedric Prince from that day forward, but plotted to someday betray him and return to Tamriel.
The Dragonborn entered Apocrypha in hopes of learning the Bend Will shout to be able to defeat Miraak. He/she eventually meets Hermaeus Mora, who teaches him/her the second word of Bend Will, but will not reveal the third unless he/she retrieves the secrets of the Skaal for him.
Storn Crag-Strider agrees to meet with Hermaeus Mora, but upon opening the Black Book, Hermaeus Mora extracts the knowledge from Storn's mind, killing him in the process. He then teaches the Dragonborn the final word of Bend Will for his/her showdown with Miraak.
Once Miraak is beaten, Hermaeus Mora kills him, stating that the Dragonborn is his new champion.