The story
The a is a reduced form of the preposition on, which was used in Old English with nouns indicating actions or states, e.g. iċ wæs on huntoþe (“I was hunting”). This is the source of such words as asleep and alive, which also show reduction of on to a. In the Middle English period, the preposition came to be used with the present participles of verbs as well (formed in -ing), eventually coming to be perceived as a mere prefix.
Etymology from Wiktionary, CC BY-SA 4.0.