Which number goes on which page
Numbers run in document order, not in the order you type pages. The first page that gets a number receives the starting number, the next one gets the number after that, and so on - so starting at 5 on a three-page file gives 5, 6 and 7 rather than renumbering the front of the file.
That is what makes continuations work. If a report is split into two files, number the second one starting at the number the first one finished on. Cover pages and tables of contents are handled by leaving them out of the list: the page list takes ranges and the words odd and even, so 2- numbers everything except the first page, and 3- skips a cover and a contents page.
The wording comes from a small set of formats - 1, Page 1, 1 of 10, Page 1 of 10 - and the "of" total is always the last number printed, not the length of the file. That keeps a continued file honest: a three-page insert numbered from 5 reads Page 5 of 7 through Page 7 of 7, which is what a reader holding the rest of the document expects to see.