I am the Quality Manager for the Paint Division of an American Truck company.
Depending on the manufacturer's options and the OEM's desires, car primer can be many different colors.
Each company uses a particular color for different reasons.
Most cathodic electrocoats are black or gray. These are also typically epoxy based. These will not stand up to UV rays from the sun. Remember the medium blue GM cars in the mid 80s that you saw peeling. UV rays penetrated the basecoat (color) paint and attacked the electrocoat layer. As the electrocoat degraded, the paint delaminated.
Anodic electrocoats will often be acrylic based. If so, they can be made to be many different colors. These will stand up to UV light and can be a final coating. Typically wheel rims, frame parts, brackets, etc.
Many companies will also "paint" the body with a primer surfacer. This will fill in any minor imperfections in the electrocoat and will give a nice smoothe surface to paint if applied properly. These also promote paint adhesion by incorporating a UV blocking material. These primers can be tinted to be nearly any color. Popular choices are: black, white, beige, or gray.
Companies choose primer colors for different reasons.
Some companies choose to primer a light color car with a dark primer so that they can see if they have good paint coverage. The same goes for the opposite. Dark car light primer.
Other companies choose to primer a car with a color close to the outside paint so that if their paint is thin in some areas, you won't notice it as much. This is normally in cracks, crevices, and areas with concave angles.
It all depends on if your paint is formulated to be black/white hiding, black/red hiding, or black/gray hiding. Each of these will use different amounts of paint to cover the primer.
There's more than you ever wanted to know probably. I could go on, but my fingers are getting tired. Hunt and peck is hard work.