Flash is waaaaaaaaay off in MD's lesson ideas - but to give you an idea of how it works in (hopefully) simple terms...
Any time flash is used is a DOUBLE exposure - one is the ambient light (so any light around from the Sun or artificial lights such as streetlights, car headlamps, torches etc. - the second exposure is the flash itself
The speed of the flash is often well in excess of 1/1,000th of a sec and it can be MUCH faster than that, so if the flash exposure is bright enough to record on your sensor then it will obviously freeze most moving things
The ambient light shutter speed may well be slow by comparison, even at the flash sync speed of 1/250th for most cameras, so if there is enough ambient light to record too on the same shot you may have such as...
Flash f5.6 1/5,000th sec AND Ambient f5.6 1/250th sec - hence the flash part of the shot freezes the fast moving action whereas the ambient part of the shot can be slow enough to blur
Extremes - if it's really dark then there may be no ambient light recorded and hence ONLY the flash exposure lights the subject - if it's bright then the ambient light may be well over 1/1,1000th sec and the flash may not be powerful enough to record at all
A common use of ambient & flash at Weddings is during the first dance... here the ambient is usually set to an exposure of around 1/25th second so of course the swishing dress is blurred but then there's a burst of flash too to freeze the action and record proper detail in the couple & dress too
I hope that helps a bit, but as I said initially this is waaaaaaaaaay down the line stuff really
DD