mid-14c., confescioun, confeccioun, "anything prepared by mixing ingredients," from Old French confeccion (12c., Modern French confection) "drawing up (of a treaty, etc.); article, product," in pharmacology, "mixture, compound," from Medieval Latin confectionem (nominative confectio) "a preparation, a medicament," in classical Latin, "a making, a preparing," noun of action from past-participle stem of conficere "to prepare," from assimilated form of com "with" (see con-) + combining form of facere "to make, to do" (from PIE root *dhe- "to set, put").
From early 15c. as "the making by means of ingredients, art or act of compounding different substances into one preparation." In late 14c. also "something prepared or made with sugar or syrup;" sense of "candies, bonbons, light pastry" predominated from 16c.
adjective and noun word-forming element, in most cases from Latin -arius, -aria, -arium "connected with, pertaining to; the man engaged in," from PIE relational adjective suffix *-yo- "of or belonging to." The neuter of the adjectives in Latin also were often used as nouns (solarium "sundial," vivarium, honorarium, etc.). It appears in words borrowed from Latin in Middle English. In later borrowings from Latin to French, it became -aire and passed into Middle English as -arie, subsequently -ary.
<a href="https://www.etymonline.com/word/confectionary">Etymology of confectionary by etymonline</a>
Harper, D. (n.d.). Etymology of confectionary. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/confectionary