This episode explain how a flash synchronizes with your camera in high speed sync mode. It would be a good idea to watch TPB #2 along with this episode to understand how shutter lag works.
When not using high speed sync the maximum shutter speed you can use is limited by the time it takes your camera to open your shutter. I measured this to be 4 ms on a Canon 30d. This corresponds perfectly with the minimum shutter duration allowed on that camera when using the flash in normal sync mode of 1/250th of a second.
One DSLR shutters there are two curtains. Whenever your shutter speed is faster than 1/250th of a second on the Canon 30d these curtains work together to only expose a slice of the scene. The faster the shutter speed the narrower that slice. This doesn’t work with traditional flashes because a flash has traditionally lit the scene for a single moment in time. So if only a narrow slice of the shutter was open when the flash triggered only that slice would be lit and the rest of scene would be black. However, modern flashes like Canon’s TTL flashes get around this by quickly strobing the flash on and off thousands of times per second. This allows each of the slices when the shutter isn’t totally open to be correctly exposed.
This article explains this camera/shutter syncing in more detail.