late 14c., "depending upon circumstances, not predictable with certainty, provisionally liable to exist," from Old French contingent or directly from Latin contingentem (nominative contingens) "happening; touching," in Medieval Latin "possible, contingent," present participle of contingere "to happen to one, befall, come to pass," originally "to touch" (see contact (v.)).
Meaning "not existing or occurring through necessity, happening by chance, accidental" is from 1610s. The noun is from 1540s, "thing happening by chance or by the will of a finite free agent;" as "a group forming part of a larger group" from 1727, originally especially "share of troops to be furnished by a power in a treaty or alliance," on the notion of "that which falls to one in a division or apportionment among a number."