I have read over this subject so many times but I cannot recall a specific book to recommend. What you’re looking for though, is something that explains the pronouncements of a couple church councils, up to and including the Council of Trent.
Trent reaffirmed the conclusions of previous councils on which are the canonical books of the Bible.
But, that’s not to say, in itself, how those books were selected. I think this drifts back into the mists of time. At the level of the council, there was always a consensus process, I believe.
What I find remarkable is how much critical thinking went into these decisions and how they 'got it right" in eliminating a lot of heretical writings.
At one level of the discussion, the effort and cost of reproducing scrolls and later codexes must have weighed heavily on the discussion.