Medieval books were typically bound before the writing started, though covers would be added at the last step. These books required a lot of pre-planning to ensure they had the correct number of pages. They didn't always get it right and you can often identify the beginning and end of sections by either a lack or excess of text on the page.
Once the number of pages needed was identified, sheets of parchment were cut to the height of the page and twice the width. Each sheet was then be folded in half to create four pages. Three or four of these pages were stacked inside each other to form a signature. The signatures were then sewn together over cords to form the text block.
Before attaching the text block to the covers, the spine was usually covered with a layer of parchment to provide additional stability. Often these pieces were offcuts of the original pages or pieces of manuscripts that were no longer needed. To attach the text block to the cover, holes were poked in the cover and the cord was threaded through and glued down. The boards and spine were then covered in leather and decorated.
The decoration served a purpose beyond looking pretty. Books were usually shelved flat so brass pieces on the corners and center would protect the leather as the book was taken off the shelf. Clasps helped reduce the wrinkling of the parchment as it reacted to seasonal changes in moisture.