The accretion history of dark matter haloes - I. The physical origin of the universal function