From Proto-Semitic *miʔat-.
The frequent form مِا۟ئَة (miʔa) has a silent alif to avoid confusion with other words in rasm (else it could look identical to مِنْهُ (min-hu, “from it, from him”)), and because it is a logogram of earlier Aramaic spellings.