If the LEM had to abort at the point of landing on the moon, the CM/SM would be about 1000 miles ahead of it when the LEM reached the same orbit. How could the 2 craft achieve rendezvous ?
Lower orbits are faster, higher is slower, so by adjusting orbit altitude you can get an orbit that gains or lags until you are in position do execute a Hohmann transfer. The orbit period is around two hours and the velocities involved around a mile a second so 1000 miles does not have to take that long to close up. Especially if you get both craft change orbit to get a better ratio. For a worst case surface abort the CSM will be an hour away in that two hour orbit, so an Lunar Module orbit that takes three hours (CSM does 1.5 two hour orbits) will get rendezvous.
The trickier part comes if your inclination is different, but for an abort straight after landing this would be unchanged.
There were specific procedures for an abort at any time during the powered descent and after landing. The abort case at the planned time of landing (about 12 minutes after PDI) is covered in this chart:
It is from the LM Rendezvous Procedures - G Mission PDF page 78. It's a bit crowded, but it shows the relative profile between CSM and LM, centered on the CSM. The important points are ABORT (time and position of the abort) and then INS (time and position of the LM orbital insertion). The insertion orbit would be be 10NM perilune and 30NM apolune. At apolune a first phasing maneuver (C1) is done, based on a crew chart or taken from Mission Control. Half an orbit later CSI1 is done, which is a height adjustment maneuver to get back to the nominal rendezvous profile and the CSI2/CDH/TPI maneuvers are then basically identical with a nominal rendezvous sequence.
So essentially one orbit of coasting in a lower orbit than the CSM is added to the nominal profile so that the LM has time to catch up to the CSM. An even later abort from the lunar surface (at the "No Go for T2" point) would even need one additional orbit to catch up.