Old English þær "in or at that place," from Proto-Germanic *thær (cf. Old Saxon thar, Old Frisian ther, Middle Low German dar, Middle Dutch daer, Dutch daar, Old High German dar, German da, Gothic þar, Old Norse þar), from PIE *tar- "there" (cf. Sanskrit tar-hi "then"), from root *to- (see the) + adverbial suffix -r.
Interjectional use is recorded from 1530s. To have been there "had previous experience of some activity" is recorded from 1877.
The most loathsome place or situation imaginable: The Soviet ''government is the pits''
[1953+; fr armpits]