Halliday & Matthiessen (2014: 490):
With [the bound non-finite clause (On) reaching the monument], however, we have a system of ASPECT: imperfective/perfective. The imperfective represents the real, or actual, mode of non-finiteness (‘realis’), while the perfective represents the potential, or virtual (‘irrealis’). So for example:
||| Reaching the monument, || continue straight ahead. |||
||| To reach the monument, || continue straight ahead. |||
Historically the imperfective combined with the preposition ‘at, in’ (cf. a-doing in the folksy what are you a-doing of?); the perfective combined – and still does, in the infinitive form – with the preposition ‘to’. The meaning of the two aspects is very fluid and indeterminate; in the most general terms, the imperfective means act in progress, actual, present, ongoing, steady state or (dependent) proposition, while the perfective means goal to be attained, potential, future, starting and stopping, change of state or (dependent) proposal. Sometimes the distinction is quite clear, as in the example above; sometimes it is very tenuous, as between the first person leaving and the first person to leave.
Note that the source of this "folksy" construction is actually Irish (and Scottish Gaelic) in which the preposition ag /ə/ ('at') precedes such verbs. The construction existed in Old Irish centuries before it came to English through bilingual speakers from Ireland and Scotland.