Most people think of using primers to cover up and hide a blemish on the wall. A water stain, the masterpiece their four year old colored in permeant marker, changing the ill-advised paint scheme of an angsty teenager, these walls and ceilings are screaming for a good priming.
They save the home owner money by reducing the number of finish coats required. That angsty black room will need many finish coats if not primed properly. It may be cheaper to completely re-drywall the room than to paint it without priming. Ironically you have to prime the new drywall.
Each type of surface that needs to be primed should be evaluated individually. New drywall or a drywall repair can be primed with a good water based primer. Water based primer works well covering a dark wall when changing to a lighter paint color. Oil based primers work really well on water stains. Make sure that the leak has stopped before any paint operation begins. Shellac primers are good for covering oder and smoke smoke.