Most of the ascent and closing with the CSM was done by a pre-programmed set of maneuvers. First, the ascent stage acheived orbit, then that orbit was matched with the CSM over several hours. They KNEW where the ascent stage and the CSM were, what their respective velocity and position were, and the radar/transponder confirmed the distance between them. Just like the supply craft which dock with ISS. It's not a one-shot deal. It's not like hitting a bullet with a bullet. It's more like two airplanes flying in formation - just without the problems caused by air. Once the vehicles were close, the rest was done by vision and manual inputs on the hand controllers.