c.1300, "what one has to do," from Anglo-French afere, Old French afaire (12c., Modern French affaire) "business, event; rank, estate," from the infinitive phrase à faire "to do," from Latin ad "to" (see ad-) + facere "to do, make" (see factitious).
A Northern word originally, brought into general use and given a French spelling by Caxton (15c.). General sense of "vague proceedings" (in romance, war, etc.) first attested 1702. Meaning "an affair of the heart; a passionate episode" is from French affaire de coeur (itself attested in English from 1809); to have an affair with someone in this sense is by 1726, earlier have an affair of love:
'Tis manifeſtly contrary to the Law of Nature, that one Woman ſhould cohabit or have an Affair of Love with more than one Man at the ſame time. ["Pufendorf's Law of Nature and Nations," transl. J. Spavan, London, 1716]
Thus, in our dialect, a vicious man is a man of pleasure, a sharper is one that plays the whole game, a lady is said to have an affair, a gentleman to be a gallant, a rogue in business to be one that knows the world. By this means, we have no such things as sots, debauchees, whores, rogues, or the like, in the beau monde, who may enjoy their vices without incurring disagreeable appellations. [George Berkeley, "Alciphron or the Minute Philosopher," 1732]