The madda answers the question of how you write a word with a long vowel at the beginning of the word. We have seen the use of a hamza to write a short vowel at the beginning of a word such as أَميرِكا (America) but what if we want to make it a long vowel 'ā'. We could write أاميرِكا but the rules of Arabic don't allow two 'alifs' to be next to each other and besides, it looks terrible. So what to do? The answer is the madda. The madda is basically an 'alif' in the shape of a tilde written horizontally above a regular vertical 'alif'. Keep in mind that this alif madda has a glottal stop. Although the hamza isn't shown, it is assumed to be there.
99.9% of the time the madda occurs at the beginning of the word, but there are a few exceptions where it occurs in the middle of the word such as قُرْآن (Qurān). It should also be noted that there is no long 'ī' or long 'ū' written at the start of a word, only long 'ā'.