late 14c., necessarie, "needed, required; essential, indispensable; such as must be, that cannot be otherwise; not voluntary or governed by chance or free will," from Old French necessaire "necessary, urgent, compelling" (13c.), and directly from Latin necessarius "unavoidable, indispensable, necessary," from necesse "unavoidable, indispensable," originally "no backing away," from ne- "not" (from PIE root *ne-) + cedere "to withdraw, go away, yield" (from PIE root *ked- "to go, yield").
The etymological sense is of that from which there is no evasion, that which is inevitable. Necessary house "privy" is from 1610s (compare Medieval Latin necessarium "a privy"). Necessary evil is from 1540s (the original reference was to "woman").
also necessaries, mid-14c., "that which is indispensable; needed, required, or useful things; the necessities of life; actions determined by right or law; that which cannot be disregarded or omitted," perhaps from Old French necessaire (n.) "private parts, genitalia; lavatory," and directly from Latin necessarius (n.), in classical Latin "a relation, relative, kinsman; friend, client, patron;" see necessary (adj.).