There are two types of flash that are still used on manual cameras (and some automatics that can be over ridden).
The M button or contact is used for Manual flash ie photographic bulbs, the X is for electronic flash.
It's all to do with their synchronisation with the shutter, the light output of a bulb lasts approximately 1/25 of a second and there is a fraction of a second delay in the shutter opening and the full intensity of the bulb being reached.
Typically an electronic flash lasts about 1/10,000 of a second and for all intents and purposes is instantaneous.
In some cameras the X and M are replaced by symbols, as in one of my old cameras (Minolta Autocord). In 1963 when I stopped using bulbs, I glued this camera in the X position to prevent accidents, if it was in the wrong position, no photograph!!