I excerpt OED, which I read because I want to understand this etymology.
-logy, comb. form
... These Greek words for the most part are parasynthetic derivatives; in some instances the terminal element is λόγος word, discourse (e.g. in τετραλογία tetralogy, τριλογία trilogy); more commonly it is the root λογ- (ablaut-variant of λεγ-, λέγειν to speak: cf. Logos n.). In the latter case, the ns. in -λογία usually denote the character, action, or department of knowledge proper to the person who is described by an adj. or n. in -λόγος, meaning either ‘(one) who speaks (in a certain way)’, or ‘(one) who treats of (a certain subject)’. Hence the derivatives in -λογία are of two classes,
(1) those which have the sense of ‘saying or speaking’, ...; and
(2) names of sciences or departments of study.
I don't know any Greek. Would someone please explain how one word can evolve into the 2 separate meanings (that I bolded)? I asked about the phrasal verb 'treat of' here.