late 15c., "building; thing made; a structure of any kind," from Middle French fabrique (14c.), verbal noun from fabriquer (13c.), from Latin fabricare "to make, construct, fashion, build," from fabrica "workshop," also "an art, trade; a skillful production, structure, fabric," from faber "artisan who works in hard materials," from Proto-Italic *fafro-, from PIE *dhabh-, perhaps meaning "craftsman" (source also of Armenian darbin "smith," and possibly also Lithuanian dabà "nature, habit, character," dabnùs "smart, well-dressed, elegant;" Russian dobryj "good," Gothic gadob "it fits," Old English gedēfe "fitting;" also see daft).
The noun fabrica suggests the earlier existence of a feminine noun to which an adj. *fabriko- referred; maybe ars "art, craft." [de Vaan]
The sense in English has evolved via "manufactured material" (1753) to "textile, woven or felted cloth" (1791). Compare forge (n.) which is a doublet.