"military dwelling place," 1590s, from quarter (n.) in sense of "portion of a town." As "part of an American plantation where the slaves live," from 1724. The military sense seems to be also the source of quartermaster and it might be behind the phrase give quarter "spare from immediate death" (1610s, often in the negative), on the notion of "provide a prisoner with shelter."[quarters etymology, quarters origin, 英语词源]