I think that a transition from mass noun to countable noun occurs when you countenance the possibility of types of the original.
We have seen that milk (a mass noun) can be treated as countable when you use the word with type qualifiers (yak milk, goat milk, many milks ... many types of milk).
Similarly "taste" may be looked at as a mass noun (if you choose to think of popular taste that way), but then becomes countable when you allow for different tastes - different types of taste: my taste in music differentiated from your taste in music - a store to suit all tastes in music.
An example given in some dictionaries of a mass noun is "happiness". But we could consider different types of happiness, and this would lead to happinesses. This example is "extreme" and doesn't sound "right" IMHO only because we don't usually think of different types of happiness, wheras it's easy to think of types of milk.
Rain is another example that leaps to mind. Swedish rain might be different to English rain, and lead us to studying the rains of the world.
I think, then, the answer to the question is "the thing that makes these abstract nouns become both countable and non-countable is our propensity to classify them into types".
Happiness and rain are not often considered to have "variants", and thus are not naturally countable. Milk and taste appear to be amenable to variants, and we can easily construct sentences with them countable.
Side note: there are other examples of where a word functions as countable and non-countable, but these appear to all be differences in meaning. For example I like coffee (mass noun) and I want to order two coffees (two cups of coffee - different meaning).
Interestingly, coffee-as-a-mass-noun can be made countable without changing its meaning to mean cups of coffe... by referring to types of coffee! If I say "coffees of the world" we know that I mean types of coffee in the world. This appears to me to further validate my suggestion that it is when we countenance differentiation of the mass noun that we get countable usage with it.