What are your favourite scholarly books? My favourite is definitely G.N. Watson's "A treatise on the theory of Bessel functions" (full text). Every single page is full of extremely precise references, ranging over 300 years of mathematics and hundreds of papers. One gets the definite impression that Watson carefully studied each and every paper he refers to.
In an entirely different field, I would say that Umberto Eco's "The search for the perfect language" (about linguistics and the evolution of language) is similarly scholarly.
Note that this question is focused on books displaying great depth and breadth of knowledge of the relevant literature, not on great mathematical writing or ``good'' undergraduate level math books (though there is not necessarily an empty intersection).