If the book is saddle-stitched, the pages are loaded into a machine that collates, folds and staples the pages and cover into completed books.  For a do it yourself version, print your pages 2 up, collate them together with a card stock cover, fold in the middle and use a saddle back stapler to finish.