Affinity is the tendency of a chemical species such as an atom or molecule to react with another to form a chemical compound.
There are also more specific uses of the word, such as electron affinity.
The affinity of a drug is its ability to bind to its biological target (receptor, enzyme, transport system, etc.) For pharmacological receptors it can be thought of as the frequency with which the drug, when brought into the proximity of a receptor by diffusion, will reside at a position of minimum free energy within the force field of that receptor.
For an agonist (or for an antagonist) the numerical representation of affinity is the reciprocal of the equilibrium dissociation constant of the ligand-receptor complex denoted K A, calculated as the rate constant for offset (k -1) divided by the rate constant for onset (k 1).