It is probably beyond the scope of this simple document to describe the operation of switch-mode power supplies (SMPSs) – suffice to say the technique relies on the voltage pulse you get from rapidly collapsing the magnetic field in an inductor. This is done many thousands of times a second and the output pulses are collected and smoothed. Whilst this sounds simple, in practice it is complex to do well – there are a number of key design decisions that have to be made, and board layout is critical – SMPSs will not work well when built on Vero/StripBoard or prototyping plug-in boards – in fact, they may not work at all!
So, if SMPSs are tricky to work with, why use them? Simple – when they work they are brilliant! They are very small, cheap, completely solid-state, run cool and can be 90% or more efficient. This last point, efficiency, can be very important. SMPSs can lower a voltage (a “buck” converter) or increase the input voltage (a “boost” converter).
Via the comments. Thanks Xevel!