then the second curtain closes to end the exposure. on the right we see that above the sync speed the first curtain opens, then the second curtain starts to close before the first curtain clears the sensor. then the flash fires and gets blocked by one of the curtains causing a black band along one edge of the photograph.
on the left you can see what happens when the flash is in sync. the flash fires when the shutter curtains are completely out of the way allowing the full image to be recorded on the camera's sensor. on the right you see what happens if your shutter speed is set too 