Wood will usually require an enamel undercoat which will seal the pores of the wood and promote topcoat adhesion with minimal lifting of the grain.
Other woods, containing extractives, cause stains which can be avoided by using a primer with stain-sealing capabilities.
Drywall or plaster may use either a simple primer that equalizes the porosity of the surface to promote uniform paint results or a stain sealer to cover water damage and other stains.
A bonding primer, designed for surfaces where adhesion may be difficult to create (previously painted surfaces where intercoat compatibility results in excess chalking), should be used in these cases.
Stucco does not need a primer though there are 100% acrylic self-primers available.