In chemical physics and physical chemistry, chemical affinity is the electronic property by which dissimilar chemical species are capable of forming chemical compounds.  Chemical affinity can also refer to the tendency of an atom or compound to combine by chemical reaction with atoms or compounds of unlike composition.
In modern terms, we relate affinity to the phenomenon whereby certain atoms or molecules have the tendency to aggregate or bond.  For example, in the 1919 book Chemistry of Human Life physician George W. Carey states that, "Health depends on a proper amount of iron phosphate Fe(PO) in the blood, for the molecules of this salt have chemical affinity for oxygen and carry it to all parts of the organism." In this antiquated context, chemical affinity is sometimes found synonymous with the term "magnetic attraction".  Many writings, up until about 1925, also refer to a "law of chemical affinity".
Ilya Prigogine summarized the concept of affinity, saying, "All chemical reactions drive the system to a state of equilibrium in which the affinities of the reactions vanish."