There are many primers used for many reasons. In complete transparency I would never, ever, recommend buying a paint with primer in it… it just does not make sense and I don’t believe it’s a thing!
Reason #1 –new drywall. When new drywall boards get painted the fibres of the board stand up, creating a rough finish. Sanding down these fibres to make them smooth again is much easier with a primer than with paint. Just a regular primer is all that is needed, and, primers are cheaper so YAY!
Reason #2 -to seal something in. Think nicotine. Yes, you can wash the walls but getting all the nicotine off is challenging at best. Have you ever seen a picture taken of the wall of a house that has had smokers in it? There is a big square where the picture remained. You could put 100 coats of latex paint over the walls and still that square would show through. There has to be a barrier between the nicotine and the latex paint, and you must use a primer designed for this problem. Likely it will be an oil-based primer or a shellac. As of the time writing this, I don’t think I would fully trust a latex primer for this purpose.
Reason #3 -to prepare the surface to paint. Some exterior doors have a window in it and these windows have a vinyl strip around them, most latex paints will not adhere to the vinyl so a primer is used to adhere to the vinyl and then the latex can adhere to the primer. Kind of like an Oreo!
Reason #4 –to help with coverage. Remember in the section about how well a color covers another color and I mentioned that red can take up to 11 coats (if you don’t use a red base paint)? What helps significantly is tinting a primer grey and using that as a base coat. The idea is to make the grey as dark as the color going on top. So red would have a pretty dark grey and yellow would have a very light grey. Please, don’t ever let a paint store tell you to make a pink primer to go under a red primer it just doesn’t work well. Imagine you are painting a white wall red. That red has to bring up the pigment all the way through all the pink type colors until it becomes red, getting darker and darker with each coat. The grey shortcuts that by making the wall as dark as the red needs to be. Now if you think a color is going to cover in three coats then the grey primer may not be needed (1 primer + two top coats = three coats anyway) but if there is a chance that it won’t cover in three for sure consider a grey primer.