Rear curtain sync, also called second curtain sync, is where you are shooting motion shots and your camera is set to flash at the end of your exposure. Using this method as opposed to first curtain sync where the flash goes off at the beginning of your exposure is useful mainly in longer exposures, for example 1/30th a second and longer.
Basically what happens is in first curtain the flash will go off at the beginning of the picture capturing what you are lighting and then burning in the rest of the scene. In this method the “ghosting” effect that you’ve seen in photographs is taken after the image. That means it will cover up the rest of the image.
With rear curtain sync there will be two flashes. A preliminary flash at the opening of the lens and then the main flash right before the curtain is closed for the exposure. This means that you are taking an image where first all of the ambient light will burn into the image and ghosting of movement will take place and then the flash will catch a sharpened well exposed version of what you are lighting.
I typically have my camera always set to rear curtain because if the exposure is short enough, the first curtain vs. rear curtain won’t matter. However for longer exposures (1/30th a second and longer) this will really help capture what you are going for more effectively.