If you want a really smooth topcoat, you usually want to sand past what you can reasonably/economically/effectively do on the substrate. Some primers are formulated to sand nicely to a powder (as opposed to balling up in clumps on the paper). You'll see this spraying higher quality paint grade work. You have to have a decent surface before you prime, but the primer can really smooth it out for the topcoat.
If you're finishing pine with knots in it, you'll want a primer that will seal the knots, otherwise the pitch will eventually bleed through and discolor the topcoat. Shellac excels at this.
Shellac is also outstanding as a sanding sealer. You can use that in a couple of ways: to fill the pores in the wood so they don't get full of sanding dust (which can be key if you have inlay of strongly contrasting woods), or to stiffen the fibers of softer woods so you can get a better/smoother sanded surface for the next steps in the finishing schedule.
Shellac is also often used as a barrier coat between otherwise incompatible finishes or when you have a relatively fragile stain layer. If you're putting an oil based finish over an oil based stain, you run the risk of picking up the stain as you apply the topcoat, especially if you're brushing or wiping the topcoat. Because the solvent in shellac is alcohol, you can pretty freely brush it over oil or water based stains without risking a disaster.
And yes, I do use primers other than shellac from time to time if I have a specific need, but dewaxed shellac is compatible with basically everything, so I always have a can around.
N.B. I'm not a professional finisher. Don't take my word on any of this; test your prep and finishing schedule on scrap!
yes, i learned this the hard way, albeit on a simple set of wall shelves as cat stairs that i can easily fix eventually with shellac and another topcoat (when i get around to it).
i.e. electroplate > primer > base > mid pearl > clear
IMO, the stores could do better about offering basic information about this, about when one would need a primer, or just a topcoat, what kinds of paint bases are appropriate for what applications, what kinds of application methods are appropriate, etc. Instead, the response of the big box stores seems to be to skip the question entirely with combined products, e.g. "paint and primer in one".
oh, and yeah, paint and primer in one does neither job very well.