Old English þær "in or at that definite place;" also "so far as, provided that, in that respect" (as to say "at that point of progress or proceeding"); from Proto-Germanic *thær (source also of 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). This is reconstructed to be from PIE *tar- "there" (source also of Sanskrit tar-hi "then"), from root *to- (see the) + adverbial suffix *-r.
Use as an indefinite grammatical subject (a fool there was) dates to Old English. Interjectional use to call attention to something ("like that!") is recorded from 1530s, variously emphasizing certainty, encouragement, or consolation. There, there as an expression of consolation is attested by 1872.
In brusque or casual address (hey, there; you, there) it is attested by 1580s. There he (or she) goes, calling attention to a way of acting, talking, etc., is by 1780. There it is expressing simplicity or consummation is by 1857.
That there as an emphatic of that is attested by 1742, a colloquial pleonasm, as though that (one) there. To have been there "had previous experience of (some activity)" is recorded from 1877. To be all there (colloquial) "have one's faculties or wits" is by 1864.