Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
The letter was originally the combination of ⟨ㅏ⟩ and ⟨ㅣ⟩ as verified from the description of the chapter "An Explanation of the Medials (中聲解)" of the Hunminjeongeum Haerye. In the 15th century, the letter was originally pronounced as the diphthong /aj/, however, it was not included with the 11 medial letters, along with ㅕ, ㅛ, ㅠ, which started with the letter ⟨ㅣ⟩.
From the 18th and 19th century, the change of pronunciations of the word is attested by confused notations with ㅔ.