TL;DR: The exposure isn't changing; the exposure simulation in liveview is being turned off.
Whenever you take a flash image, you're basically combining two different exposures from two different sources of light: the ambient (all the light in the scene that isn't from the flash) and the flash. And these two exposures can be at different levels, because they rely on different settings. Ambient exposure is determined by iso, aperture, and shutter speed. But flash exposure is determined by iso, aperture, power, and flash-to-subject distance.
On any camera the metering system can only measure the light that's in the scene. A flash burst isn't in the scene yet while you're composing, so the exposure system/simulation can't account for it. It can only show you the ambient portion of the exposure.
If you have your iso, aperture, and shutter speed set to underexpose the ambient (or kill it), then that's what exposure simulation in liveview is going to show you: a very underexposed image.
Your camera has been programmed to understand this is a very common scenario with flash, so as soon as a flash is sensed, exposure simulation is turned off; and the scene in liveview is simply displayed so you can best see what you're doing (i.e., the camera ignores the exposure settings and just treats the image as if the settings let the ambient be well-exposed at "0").
Some cameras do not do this, and you have to manually turn off exposure simulation to see what you're doing in the viewfinder with flash.