I used to wonder why Ph.D. stands for “Doctor of Philosophy.” After all, shouldn’t it be a Doctor of Physics, or Math(s), or Literature or Finance? That’s what someone spent years and years studying?
But it turns out that the Ph.D. is not so much about building knowledge of a subject. That’s what a Master’s is for. Master of Finance, Master of Business Administration, Master of French Literature, whatnot.
A Ph.D. is a doctor of philosophy because you learn how to evaluate evidence, how to spot logical fallacies, how to analyze the coherence of ideas. Basically, you learn a fair amount of philosophy: epistemology, to be precise - how do you know what you know? why do you know it and with what level of certainty? what evidence do you need to demonstrate that something is true, and how would one go about finding that evidence. What alternative explanations might this evidence support instead, and are those more likely than the one you prefer. It’s about how to make effective arguments, not so much about knowledge of a subject matter (though the techniques often differ by subject matter).
So yes, “I have a Ph.D. and you are trying to argue with me?” is not so much about how you don’t know enough about X, it’s about how you don’t know enough to think coherently. The one caveat that should be observed is that sometimes Ph.D.s overstep their disciplinary bounds. Physicists, for example, often think that social phenomena can be mathematized the way physical phenomena can, and therefore are ill equipped to handle analyses where quantitative data is lacking or unreliable. Nonquantitative Ph.D.s often make the reverse mistake, but less often.