The vast majority of electrical/electronic projects will require an external source of electrical power (except those solely powered by battery, solar energy or similar). Further, generally in the home setting (and or office or similar location) the wide availability of AC electricity (120 or 240 VAC depending upon location) predisposes electrical/electronic projects to be powered by DC produced from such domestic/commerical AC mains supply.
Producing DC from such AC mains supply requires suitable transformers, rectifiers and regulation circuitry and in the case of switched-mode power supplies even more complicated circuitry. All of which can be rather costly and or difficult to produce in the DIY setting.
Above all, such AC to DC conversion obviously involves dealing directly with AC from the mains supply with the inherent dangers this entails. For the typical DIY'er or hobbyist, avoiding directly dealing with mains AC should be a primary objective to safely practice hobby electronics. This is the major advantage of using "wall warts" as a power supply option for hobby electronics projects. Also conveniently, "wall warts" are generally readily available for "free" due to surplus/disused and or damaged electrical applicances which are often powered by "wall warts" of one variety or other (and or can be cheaply purchased online).
For a detailed summary of "wall warts" (also known as AC/DC adapter, AC/DC converter, plug pack, plug-in adapter, adapter block, domestic mains adapter, line power adapter, wall wart, power brick, and power adapter) the interested reader should refer to the Wikipedia link amongst other online references (1), (2).
Wall warts come in two major varieties, linear power supply and switched-mode power supply (SMPS). The linear power supply variety (which tends to have been superceded in current consumer electronic equipment) contains a transformer, rectifier and filtering circuitry, and can generally be identified by the "weight" (as the transformer inside tends to be heavy, particularly for the higher voltage/amperage models). SMPS are now probably the most wide spread which rely upon high frequency switching of the AC through inductors and capacitors to transform the AC to DC. SMPS, due to lack of the need for large/heavy transformer, tend to be very light.
Consequently, linear power supply wall warts tend to be less efficient, and often due to being designed and manufactured to a "price point" (i.e., as cheaply as possible) have considerable residual ripple in the output DC, output voltage varies with load (i.e. poor regulation) and produce significant dissipated heat even when not driving a load.
SMPS wall warts tend to be more efficient, smaller, and lighter device. In both cases a transformer is required, and thus both provide safety as the mains AC is isolated. Further, in terms of the DIY hobbyist, any commerically available wall wart (either linear or SMPS) is the safer option being produced by professional electrical engineers and commercial manufacturing process, rather than wiring up a DIY circuit to handle mains electricity.
Although, the cavaet here being to be wary of very "cheap" imported equipment that may not have undergone appropriate design and manufacturing QC/QA etc.
Selecting and Using a Wall Wart
Selection of an appropriate wall wart for a particular project obviously involves matching the wall wart output voltage, current capacity and voltage regulation ability to the circuit/project in question.
The usual microcontroller project involves 5V (or increasingly 3.3V) and since linear voltage regulator IC's (e.g. 78xx or LM3xx series) are easily available for very low cost, I tend to always use a wall wart to supply the DC voltage from the AC mains, that in turn is input to a LM317 or 7805 linear voltage regulator (with suitable filter capacitors). This means the nasty problems of cheap wall warts producing voltage sag under load and or having significant output voltage ripple is negated to a large degree. Although, you still need to ensure that the selected wall wart can supply adequate current for the expected load condition and that the wall wart output voltage needs to be ~3V higher than the desired output of the 78xx or LM3xx series linear voltage regulator.
Therefore, if using a 78xx or LM3xx series linear voltage regulator with a wall wart to supply the input DC from mains AC, wall wart selection is rather straight forward, particularly for microcontroller projects which tend to be 3.3V to 5V DC with a maximum load of <1A. If the objective is to provide a target circuit with 9V, 12V etc and to use the DC output from the wall wart directly, then the selection process is a little more complex. In such cases, additional filtering capacitors may be required "downstream" of the wall wart and or the DC output voltage of the wall wart being higher then the nominal requirement to allow for voltage sag under load.
The Schematic Diagrams and Circuit Details section provide information about practical circuits for using wall warts as DC power supply for DIY projects (largely based upon 78xx or LM3xx series linear voltage regulator datasheets).
The final recommendation is to ensure you salvage and hoard away all disused wall warts from equipment that is to be throw away. Having a wide selection of wall warts in the "junk box" is invaluable come DIY project power supply design time.