1798, as a term in mathematics, "pertaining to modulation," from French modulaire or directly from Modern Latin modularis, from Latin modulus "a small measure," diminutive of modus "measure, manner" (from PIE root *med- "take appropriate measures"). Meaning "composed of interchangeable units" is recorded by 1936.
word-forming element making abstract nouns from adjectives and meaning "condition or quality of being ______," from Middle English -ite, from Old French -ete (Modern French -ité) and directly from Latin -itatem (nominative -itas), suffix denoting state or condition, composed of -i- (from the stem or else a connective) + the common abstract suffix -tas (see -ty (2)).
Roughly, the word in -ity usually means the quality of being what the adjective describes, or concretely an instance of the quality, or collectively all the instances; & the word in -ism means the disposition, or collectively all those who feel it. [Fowler]