early 14c., "a basket or pannier for carrying on the back," originally Scottish and northern England, of unknown origin. Perhaps from Old French greil, grail "a grill," from Latin craticula "small griddle" (see grill (n.)).
The sense of "a framework" for any purpose is attested by 1788, but it is not certain these senses are the same word. Specifically "framework for holding bobbins or spools in a spinning machine" is by 1835.