Understanding flash sync speed

Photo by Tom Pumford on Unsplash

So what is flash sync speed?

It is the maximum shutter speed you can use to “sync” with a flash. An external flash is a flash that sits on the hot shoe of the camera or is remotely triggered off camera. An internal flash would be one that is built into the camera itself such as a small pop-up flash.

Why is there a limitation on shutter speed when using a flash?