PhD (or DPhil, if you come from Oxford) stands for "Doctor of Philosophy" but is the name used for most doctorate level research degrees to distinguish them from medical doctors. Occasionally doctorates are issued under other names (e.g. EngD - engineering doctorate) but these are usually broadly equivalent (confusingly with the exception of the DSc (Doctor of Science) which is a higher doctorate, and rarely encountered (even more confusingly what is now a PhD was historically (pre 19th century) known as a DSc)) to a PhD.
Plus the exact meaning and usage of all these terms varies with both time and place.
(The title doctor of philosophy makes sense if you remember that in olden days just about everything was either "philosophy" (arts and humanities) or "natural philosophy" (science and maths).)