Mechanism of the transition from fractal to dendritic growth of surface aggregates