In the good old days before Edgerton invented the Electronic flash in 1931, flash photography meant burning chemicals. Initially in the open air, and then more conveniently in sealed flashbulbs. Chemical flash isn't instantaneous, it takes about 10 milliseconds to burn, and there is a peak in its intensity. Consequently flash synchronisation was all about timing the flash to ensure that the shutter was open during the peak of the flash intensity.
Electronic flash was based on exciting molecules of a gas like Xenon, in a tube. The initial output of the flash rises to a peak almost instantly and then falls off over a longer period of time. At full power the flash duration of a flashgun like the Nikon SB25 is 1/500s or 2 milliseconds. But clever circuitry within the flash can drop the output of the flash to zero nearly instantaneously. So its possible at lower powers to get very short flash durations indeed.
The short duration of electronic flash makes it possible to do things like freeze motion, by only lighting the subject with the flash. It also allows you to control your ambient exposure by altering the shutter speed, without affecting your flash exposure; so that you can overpower the sun.
So the flash is the easy bit, now we need to understand how the camera's shutter works. On most cameras, the the shutter has two curtains the first of which is covering the exposed sensor. When the shutter release is pressed, the first curtain exposes the sensor and the second covers it up again. Now the thing that may be hard to grasp is that when we talk about shutter speed, we are not talking about the speed at which the shutter passes over the sensor, we are actually talking about the length of time that a single point on the sensor is exposed to light. So imagine we have set the camera for a 1/200s exposure. We press the shutter release, and the first curtain starts to open, 1/200s later the second curtain starts to close. The animation on the left shows this in action.
So far so good, but now it starts getting tricky. There is a practical limit to how fast your shutter can move across the sensor, too fast and it increases wear and tear. So many cameras have a maximum speed of about 1/200s or thereabouts. This limit means that in order to get exposure times shorter than 1/200s the second curtain has to start closing before the first curtain has finished exposing the sensor, in effect there is a slit moving across the sensor in 1/200s. The smaller the slit, the shorter the exposure. The animation on the left shows that slit moving across the frame
So what does this have to do with flash photography? If the top speed of the curtains is 1/200s and the flash duration is about 1/500s that means that the flash duration is shorter than the time it takes to fully expose the sensor. So you need to fire the flash at the point that both curtains are fully open, otherwise when the flash fires, part of the image will be covered by one of the curtains. The maximum shutter speed at which both curtains will be open long enough for a flash exposure is known as the X-Sync speed.
Now, if you are as dumb as me, I know what your thinking. What if the flash duration is longer than the shutter speed? If the shutter is 1/4000s and the Flash duration is 1/500s then surely if you triggered the flash the instant the shutter opened, then the flash would be burning for the entire time that the slit between the shutters is moving across the sensor and everything would be lit? But if you were paying attention earlier you will have realised that if your x-sync speed is 1/200s then regardless of the exposure time you set on the camera, your shutter moves at a constant 1/200s to move from one end of the frame to the other, so you will still get a shadow from the shutter on the picture.
Some camera manufacturers have flashes that are capable of High Speed Sync, this allows the flash to synchronise at any speed. The way this works is that the flash duration is extended by making the flash fire multiple times at high speed, extending the time the flash is lit, to cover the entire length of the exposure. Effectively turning the flash into a short duration continuous light source. The flash fires a soon as the first curtain starts to open and stays lit until the second curtain has fully closed. Its great, but you will lose lots of power.
So thats as far as I will take you on this geeky journey. Not all cameras work in this way, some have electronic shutters and can sync at any speed, and there are many other kinds of shutters, but this article covers the reality for many of you. I hope it helps.