Even transformers have issues - mains wiring can pick up high voltage spikes when there
is nearby lightning or even fluorescent lights nearby, mains devices have to be able to
deal with a lot more than the nominal voltage.
The low-voltage side of a transformer will also see a spike in proportion so you need to
allow for a (say) 5V output transformer producing perhaps 20V spikes occasionally.
This means using a current-limiting resistor on the transformer output to protect the
delicate circuitry. Also the quality of mains power varies a lot - rural supplies are more
susceptible to lightning surges.