Combining أ and ل gives you the definitive article ال. Now, if you combine ل with ا, for example in سلام it will create this shape لا which is pronounced lâ. To allow for the separation Al and Azhar, there must be the ء sign. الازهر would be read alâzhar but we want Al-Azhar so we need ء and write الأزهر. The rest is just vowel signs.