c.1300, "pile, heap, or group of things," from O.N. stakkr "haystack" (cf. Dan. stak, Swed. stack "heap, stack"), from P.Gmc. *stakkoz, from PIE *stognos- (cf. O.C.S. stogu "heap," Rus. stog "haystack," Lith. stokas "pillar"), from base *steg- "pole, stick" (see
stake (n.)).
Meaning "set of shelves on which books are set out" is from 1879. Used of the chimneys of factories, locomotives, etc., since 1825. The verb is attested from early 14c., "to pile up grain;" the meaning "arrange unfairly" (in stack the deck) is first recorded 1825. Stack up "compare against" is 1903, from notion of piles of poker chips (1896). Stacked, of women's bodies, "well-built in a sexual sense" is from 1942.