Setting type by hand is great for small jobs, but impractical and uneconomic for anything that has more than a few lines of type. That's where the Monotype composition caster comes in.
The Monotype system was a mainstay of book production for most of the twentieth century. Each letter and space is cast as an individual character in the order demanded by the copy. The letters build into words, the words into lines, the lines into paragraphs and the paragraphs into whole pages. There's a Wikipedia article that explains how it works here.