How does a power surge reset a modem?
Often what happens in this sort of situation is not that the surge resets the configuration, but that it's sufficient to flip one bit of the configuration, such that a checksum then fails and the software decides to reset all the config to its factory settings.

Basically, high voltages push high currents, and fast-changing high currents can induce current in adjacent conductive objects, which can create the right conditions for the very tiny and delicate structures which make up non-volatile memory to change state.