1650s, "of or pertaining to the hair," from Latin capillaris "of hair," from capillus "hair" (of the head); perhaps related to caput "head" (but de Vaan finds this "difficult on the formal side" and "far from compelling, since capillus is a diminutive, and would mean 'little head', which hardly amounts to 'hair'"). The Latin word was borrowed earlier in English as capillar "hair-like" (c. 1400, of veins, etc.).
In modern anatomy, of tube-like structures, "having so small a bore that water will not run through it" (1742). From 1809 in reference to the phenomena of the rise of liquids in tubes, etc., by surface tension, on the notion of "taking place in capillary vessels;" hence capillary attraction (1813), etc. As a noun, "minute blood vessel," from 1660s.